blob: a00bc5c167c4ed6250e4160b2614e742a271b8ee [file] [log] [blame]
// PR c++/16333
struct X {
X (const int (&)[3]);
};
int a[3];
X foo1 () { return a; }
const X &foo2 () { return a; } // { dg-warning "returning reference to temporary" }
X &foo3 () { return a; } // { dg-error "cannot bind non-const lvalue ref" }