]>
git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.dg/c2x-attr-fallthrough-5.c
c614ceba2056b278e5dfdc9cb7fef27f5733960e
1 /* Test C2x fallthrough attribute: mixtures with other attributes. */
2 /* { dg-do compile } */
3 /* { dg-options "-std=c2x -pedantic-errors" } */
5 /* Use of other standard attributes together with "fallthrough" goes
6 through a different path to diagnosing ignored attributes from that
7 used in attribute declarations without "fallthrough". Verify that
8 such ignored attributes result in a pedwarn (for use in a context
9 not permitted in the constraints for those attributes) in this case
19 [[fallthrough
, deprecated
]]; /* { dg-error "attribute ignored" } */
22 [[maybe_unused
]] [[fallthrough
]]; /* { dg-error "attribute ignored" } */
25 [[__nodiscard__
, fallthrough
]]; /* { dg-error "attribute ignored" } */