gcc/testsuite/g++.dg/cpp0x/elision_weak.C
raw| 1 | // { dg-do compile } |
| 2 | |
| 3 | struct S |
| 4 | { |
| 5 | S() {} |
| 6 | S(S&) {} |
| 7 | }; |
| 8 | |
| 9 | S f() |
| 10 | { |
| 11 | S s; |
| 12 | return s; // { dg-error "cannot bind non-const lvalue reference" "" { target c++23 } } |
| 13 | } |
| 14 | |
| 15 | void g() |
| 16 | { |
| 17 | S s; |
| 18 | throw s; // { dg-error "cannot bind non-const lvalue reference" "" { target c++23 } } |
| 19 | } |