Debian Codegraph @

gcc/testsuite/gdc.test/fail_compilation/test24084.d

raw
1 /* REQUIRED_ARGS: -nothrow
2 * TEST_OUTPUT:
3 ---
4 fail_compilation/test24084.d(110): Error: cannot use `throw` statements with -nothrow
5 fail_compilation/test24084.d(112): Error: cannot use try-catch statements with -nothrow
6 ---
7 */
8
9 // https://issues.dlang.org/show_bug.cgi?id=24084
10
11 #line 100
12
13 struct S
14 {
15 int x;
16 ~this() { }
17 }
18
19 void xyzzy()
20 {
21 S s;
22 throw new Exception("xx");
23
24 try
25 {
26 int y;
27 } catch (Exception) { }
28 }