(root)/
gcc-13.2.0/
gcc/
testsuite/
g++.dg/
cpp2a/
nodiscard-constructor1.C
/* nodiscard attribute tests  */
/* { dg-do compile { target c++20 } } */
/* { dg-options "-O" } */

struct A { [[nodiscard("bad constructor")]] A() {} };
struct B { [[nodiscard]] B() {} };

void
test (void)
{
  A{}; /* { dg-warning "nodiscard\[^\n\r]*bad constructor" } */
  B{}; /* { dg-warning "nodiscard" } */
}