gcc/ChangeLog:
[official-gcc.git] / gcc / testsuite / g++.dg / warn / Wswitch-unreachable-1.C
blob99d9a8332177701cf41b18277eda171984db4d99
1 // { dg-do compile }
3 extern int j;
5 void
6 f (int i)
8   switch (i) // { dg-warning "statement will never be executed" }
9     {
10       try
11       {
12       }
13       catch (...)
14       {
15       }
16     case 1:;
17     }
20 void
21 g (int i)
23   switch (i)
24     {
25       try
26       {
27         j = 42;  // { dg-warning "statement will never be executed" }
28       }
29       catch (...)
30       {
31       }
32     case 1:;
33     }