summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/gnu2x-attr-syntax-2.c
blob: 97d1654d9f6a02d507b0b7ee7a6ef1631dfa278d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* Test C2x attribute syntax.  Invalid uses of attributes with GNU C
   features.  */
/* { dg-do compile } */
/* { dg-options "-std=gnu2x -w" } */

/* Attributes cannot be used as prefix attributes on old-style
   parameter declarations or on function declarators with identifier
   lists (removed from C2x).  */

void (*f(a, b) [[]])() int a, b; { } /* { dg-error "expected" } */

void f(x, y) int x; [[]] int y; { } /* { dg-error "expected" } */

/* Nonempty attributes cannot be used as postfix attributes with
   __auto_type.  */
__auto_type [[gnu::no_such_attr]] x = 1; /* { dg-error "'__auto_type' followed by" } */