mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 05:00:16 +03:00
34 lines
645 B
D
34 lines
645 B
D
/*
|
|
TEST_OUTPUT:
|
|
---
|
|
fail_compilation/fail4082.d(14): Error: destructor `fail4082.Foo.~this` is not `nothrow`
|
|
fail_compilation/fail4082.d(12): Error: function `fail4082.test1` may throw but is marked as `nothrow`
|
|
---
|
|
*/
|
|
struct Foo
|
|
{
|
|
~this() { throw new Exception(""); }
|
|
}
|
|
nothrow void test1()
|
|
{
|
|
Foo f;
|
|
|
|
goto NEXT;
|
|
NEXT:
|
|
;
|
|
}
|
|
|
|
/*
|
|
TEST_OUTPUT:
|
|
---
|
|
fail_compilation/fail4082.d(32): Error: destructor `fail4082.Bar.~this` is not `nothrow`
|
|
fail_compilation/fail4082.d(32): Error: function `fail4082.test2` may throw but is marked as `nothrow`
|
|
---
|
|
*/
|
|
struct Bar
|
|
{
|
|
~this() { throw new Exception(""); }
|
|
}
|
|
nothrow void test2(Bar t)
|
|
{
|
|
}
|