blob: cc9bb59770ee253bdaa32dae9a386158aac1f2b4 [file] [log] [blame]
// { dg-do assemble }
// { dg-options "-Wno-return-local-addr" }
int& bad1()
{
int x = 0;
return x; // { dg-error "cannot bind non-const lvalue reference" "" { target c++23 } }
}
int* bad2()
{
int x = 0;
return &x;
}
int f();
const int& bad3()
{
return f();
}
const int& bad4()
{
return int();
}