Fortran: Fix PR 47485.
[gcc.git] / gcc / testsuite / g++.dg / warn / Wimplicit-fallthrough-3.C
blob2f06817d9ee8a2296187402dad589a958bf64158
1 // Verify that there are no spurious warnings in nested switch statements due
2 // to the unnecessary break in the inner switch block.
3 // { dg-do compile }
4 // { dg-options "-Wimplicit-fallthrough" } */
6 int
7 foo (int c1, int c2, int c3)
9   switch (c2)
10     {
11     case 0:   
12       switch (c3)       // { dg-bogus "may fall through" }
13         {
14         case 0:
15           if (c1)
16             return 1;
17           else
18             return 2;
19           break;
21         default:
22           return 3;
23         }
25     case 1: 
26       return 4;
27     default:
28       return 5;
29       break;
30     }