aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/nodiscard-reason-nonstring.C
blob: cbc04b406c6fb73e830c0b49ab396021ee171453 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
/* nodiscard attribute tests  */
/* { dg-do compile { target c++20 } } */
/* { dg-options "-O" } */

[[nodiscard(123)]] int check1 (void); /* { dg-error "nodiscard\[^\n\r]*must be a string constant|expected string-literal" } */

void
test (void)
{
  check1 ();
  (void) check1 ();
}