gcc/testsuite/g++.old-deja/g++.brendan/crash55.C
raw| 1 | // { dg-do compile } |
| 2 | // GROUPS passed old-abort |
| 3 | extern int f(int); // { dg-message "old declaration" } |
| 4 | |
| 5 | int& f(int x) // { dg-error "new declaration" } |
| 6 | { |
| 7 | int local; |
| 8 | |
| 9 | local = x+2; |
| 10 | |
| 11 | return local; // { dg-warning "reference to local" "" { target c++20_down } } |
| 12 | // { dg-error "non-const lvalue" "" { target c++23 } .-1 } |
| 13 | } |