1 /* Test C2x attribute syntax. Invalid use of fallthrough attribute in
2 bad context inside switch. */
3 /* { dg-do compile } */
4 /* { dg-options "-std=c2x -pedantic-errors -Wextra" } */
5
6 int
7 f (int a)
8 {
9 switch (a)
10 {
11 case 1:
12 a++;
13 [[fallthrough]]; /* { dg-error "attribute 'fallthrough' not preceding a case label or default label" } */
14 a++;
15 [[fallthrough]]; /* { dg-error "attribute 'fallthrough' not preceding a case label or default label" } */
16 }
17 return a;
18 }