blob: f6358c9115b4e263dc6a77ffefa0b31db16d9d6d [file] [log] [blame]
/* nodiscard attribute tests */
/* { dg-do compile { target c++2a } } */
/* { 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" } */
}