| 1 |
/* Test __has_c_attribute. Test syntax errors. */ |
| 2 |
/* { dg-do preprocess } */ |
| 3 |
/* { dg-options "-std=c23 -pedantic-errors" } */ |
| 4 |
|
| 5 |
#if __has_c_attribute /* { dg-error "missing '\\('" } */ |
| 6 |
#endif |
| 7 |
|
| 8 |
#if __has_c_attribute 0 /* { dg-error "missing '\\('" } */ |
| 9 |
#endif |
| 10 |
|
| 11 |
#if __has_c_attribute (0 /* { dg-error "requires an identifier" } */ |
| 12 |
#endif |
| 13 |
|
| 14 |
#if __has_c_attribute (x /* { dg-error "missing '\\)'" } */ |
| 15 |
#endif |
| 16 |
|
| 17 |
#if __has_c_attribute (x::0) /* { dg-error "required after scope" } */ |
| 18 |
#endif |