mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 21:21:48 +03:00
20 lines
434 B
D
20 lines
434 B
D
// https://issues.dlang.org/show_bug.cgi?id=8150: nothrow check doesn't work for constructor
|
|
/*
|
|
TEST_OUTPUT:
|
|
---
|
|
fail_compilation/bug8150a.d(14): Error: `object.Exception` is thrown but not caught
|
|
fail_compilation/bug8150a.d(12): Error: constructor `bug8150a.Foo.this` may throw but is marked as `nothrow`
|
|
---
|
|
*/
|
|
|
|
struct Foo
|
|
{
|
|
this(int) nothrow
|
|
{
|
|
throw new Exception("something");
|
|
}
|
|
}
|
|
|
|
void main() {
|
|
Foo(1);
|
|
}
|