Debian Codegraph @

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

raw
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/goto3.d(1010): Error: case cannot be in different `try` block level from `switch`
5 fail_compilation/goto3.d(1012): Error: default cannot be in different `try` block level from `switch`
6 ---
7 */
8
9
10 void foo();
11 void bar();
12
13 #line 1000
14
15 void test1()
16 {
17 int i;
18 switch (i)
19 {
20 case 1:
21 try
22 {
23 foo();
24 case 2:
25 { }
26 default:
27 { }
28 }
29 finally
30 {
31 bar();
32 }
33 break;
34 }
35 }