1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
// { dg-do assemble } // { dg-options "-Wno-return-local-addr" } int& bad1() { int x = 0; return x; } int* bad2() { int x = 0; return &x; } int f(); const int& bad3() { return f(); } const int& bad4() { return int(); }