diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/c1x-static-assert-4.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/c1x-static-assert-4.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/c1x-static-assert-4.c b/gcc/testsuite/gcc.dg/c1x-static-assert-4.c new file mode 100644 index 0000000..ebc95f5 --- /dev/null +++ b/gcc/testsuite/gcc.dg/c1x-static-assert-4.c @@ -0,0 +1,13 @@ +/* Test C1X static assertions. More invalid assertions. */ +/* { dg-do compile } */ +/* { dg-options "-std=c1x -pedantic-errors" } */ + +/* Static assertions not valid in old-style parameter declarations + because declarations there must have declarators. */ + +void +f (i) + int i; + _Static_assert (1, ""); /* { dg-error "expected" } */ +{ +} |