Debian Codegraph @

gcc/testsuite/g++.dg/conversion/pr16333.C

raw
1 // PR c++/16333
2
3 struct X {
4 X (const int (&)[3]);
5 };
6
7 int a[3];
8 X foo1 () { return a; }
9 const X &foo2 () { return a; } // { dg-message "returning reference to temporary" }
10 X &foo3 () { return a; } // { dg-error "cannot bind non-const lvalue ref" }