Debian Codegraph @

gcc/testsuite/g++.dg/warn/Wdangling-reference23.C

raw
1 // PR c++/115361
2 // { dg-additional-options -Wdangling-reference }
3
4 struct B { int i; };
5
6 struct A {
7 const int & operator()(const B& b) { return b.i; }
8 };
9
10 int main()
11 {
12 B b = {};
13 const int &r = A()(b);
14 }