aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/c2x-has-c-attribute-4.c
blob: acd35d2d5ac4067dc571f5bbc61373274b7769f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* Test __has_c_attribute.  Test syntax errors.  */
/* { dg-do preprocess } */
/* { dg-options "-std=c2x -pedantic-errors" } */

#if __has_c_attribute /* { dg-error "missing '\\('" } */
#endif

#if __has_c_attribute 0 /* { dg-error "missing '\\('" } */
#endif

#if __has_c_attribute (0 /* { dg-error "requires an identifier" } */
#endif

#if __has_c_attribute (x /* { dg-error "missing '\\)'" } */
#endif

#if __has_c_attribute (x::0) /* { dg-error "required after scope" } */
#endif