Debian Codegraph @

gcc/testsuite/g++.dg/cpp1z/nodiscard5.C

raw
1 // PR c++/80896
2 // { dg-do compile { target c++11 } }
3
4 int x = 42;
5 [[nodiscard]] int& func() { return x; }
6
7 int main() { func(); } // { dg-warning "ignoring return value" }