1 2 3 4 5 6 7 8 9 10
// { dg-do compile { target c++11 } } struct [[nodiscard]] A { }; // { dg-message "" } A f(); // { dg-message "" } int main() { f(); // { dg-warning "Wunused-result" } }