| 1 |
/* nodiscard attribute tests */ |
| 2 |
/* { dg-do compile { target c++20 } } */ |
| 3 |
/* { dg-options "-O" } */ |
| 4 |
|
| 5 |
[[nodiscard, nodiscard]] int check1 (void); // { dg-warning "specified multiple times" } |
| 6 |
|
| 7 |
void |
| 8 |
test (void) |
| 9 |
{ |
| 10 |
check1 (); // { dg-warning "nodiscard" } |
| 11 |
(void) check1 (); |
| 12 |
} |