Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/gcc.dg/c2x-attr-fallthrough-6.c @ 152:2b5abeee2509
update gcc11
author | anatofuz |
---|---|
date | Mon, 25 May 2020 07:50:57 +0900 |
parents | 1830386684a0 |
children |
line wrap: on
line source
/* Test C2x attribute syntax. Invalid use of fallthrough attribute in bad context inside switch. */ /* { dg-do compile } */ /* { dg-options "-std=c2x -pedantic-errors -Wextra" } */ int f (int a) { switch (a) { case 1: a++; [[fallthrough]]; /* { dg-error "attribute 'fallthrough' not preceding a case label or default label" } */ a++; [[fallthrough]]; /* { dg-error "attribute 'fallthrough' not preceding a case label or default label" } */ } return a; }