gcc/testsuite/g++.dg/cpp2a/nodiscard-reason-nonstring.C
raw| 1 | /* nodiscard attribute tests */ |
| 2 | /* { dg-do compile { target c++20 } } */ |
| 3 | /* { dg-options "-O" } */ |
| 4 | |
| 5 | [[nodiscard(123)]] int check1 (void); /* { dg-error "nodiscard\[^\n\r]*must be a string constant|expected string-literal" } */ |
| 6 | |
| 7 | void |
| 8 | test (void) |
| 9 | { |
| 10 | check1 (); |
| 11 | (void) check1 (); |
| 12 | } |