aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/nodiscard-once.C
blob: c533f9cf7d0c3113af7cc9ef1e466a68c90cd6c1 (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, nodiscard]] int check1 (void); // { dg-warning "specified multiple times" }

void
test (void)
{
  check1 ();			// { dg-warning "nodiscard" }
  (void) check1 ();
}