2 // { dg-do compile { target c++11 } }
3 // { dg-options "-Wextra -Wall -Wpedantic" }
9 [[gnu::fallthrough]] int j = 0; // { dg-warning "attribute ignored" }
12 [[gnu::fallthrough]]; // { dg-error "invalid use" }
14 [[gnu::fallthrough]]; // { dg-error "invalid use" }
17 [[gnu::fallthrough]]; // { dg-warning "statement will never" }
22 if (i) // { dg-warning "statement may fall through" }
33 [[gnu::fallthrough]]; // { dg-warning "not preceding" }
39 if (i) // { dg-warning "statement may fall through" }
51 bar (7); // { dg-warning "statement may fall through" }
56 [[gnu::fallthrough]]; // { dg-error "invalid use" }