Sign in
gnu
/
gcc
/
ab810952eb7c061e37054ddd1dfe0aa033365131
/
.
/
gcc
/
testsuite
/
g++.dg
/
conversion
/
pr16333.C
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" }