view gcc/testsuite/gcc.dg/c2x-attr-fallthrough-3.c @ 157:dafe684d005c

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:08:54 +0900
parents 1830386684a0
children
line wrap: on
line source

/* Test C2x attribute syntax.  Invalid use of fallthrough attribute
   outside switch.  */
/* { dg-do compile } */
/* { dg-options "-std=c2x -pedantic-errors -Wextra" } */

int
f (int a)
{
  [[fallthrough]]; /* { dg-error "invalid use of attribute 'fallthrough'" } */
  return a;
}