gcc/testsuite/g++.dg/warn/Wimplicit-fallthrough-4.C
raw| 1 | // PR c++/91024 |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | // { dg-options "-Wimplicit-fallthrough" } |
| 4 | |
| 5 | int |
| 6 | foo (char c) |
| 7 | { |
| 8 | int result = 0; |
| 9 | |
| 10 | switch (c) |
| 11 | { |
| 12 | case 'O': |
| 13 | case 'K': |
| 14 | return result; |
| 15 | [[unlikely]] case 'X': // { dg-bogus "this statement may fall through" } |
| 16 | case 'x': // { dg-bogus "here" } |
| 17 | return result; |
| 18 | default: |
| 19 | break; |
| 20 | } |
| 21 | return result; |
| 22 | } |