1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/fail4082.d(14): Error: destructor `fail4082.Foo.~this` is not nothrow
5 fail_compilation/fail4082.d(12): Error: nothrow function `fail4082.test1` may throw
6 ---
7 */
8 struct Foo
9 {
10     ~this() { throw new Exception(""); }
11 }
12 nothrow void test1()
13 {
14     Foo f;
15 
16     goto NEXT;
17 NEXT:
18     ;
19 }
20 
21 /*
22 TEST_OUTPUT:
23 ---
24 fail_compilation/fail4082.d(32): Error: destructor `fail4082.Bar.~this` is not nothrow
25 fail_compilation/fail4082.d(32): Error: nothrow function `fail4082.test2` may throw
26 ---
27 */
28 struct Bar
29 {
30     ~this() { throw new Exception(""); }
31 }
32 nothrow void test2(Bar t)
33 {
34 }
35