gcc/testsuite/gcc.dg/c23-attr-maybe_unused-3.c
raw| 1 | /* Test C23 maybe_unused attribute: invalid syntax. */ |
| 2 | /* { dg-do compile } */ |
| 3 | /* { dg-options "-std=c23 -pedantic-errors" } */ |
| 4 | |
| 5 | [[maybe_unused()]] int a; /* { dg-error "does not take any arguments" } */ |
| 6 | |
| 7 | [[maybe_unused(0)]] int b; /* { dg-error "does not take any arguments|expected" } */ |
| 8 | |
| 9 | [[maybe_unused("", 123)]] int c; /* { dg-error "does not take any arguments|expected" } */ |
| 10 | |
| 11 | [[maybe_unused("")]] int d; /* { dg-error "does not take any arguments|expected" } */ |