gcc/testsuite/g++.dg/cpp0x/ref-qual4.C
raw| 1 | // 12.1: A constructor shall not be declared with a ref-qualifier. |
| 2 | // 12.4: A destructor shall not be declared with a ref-qualifier. |
| 3 | |
| 4 | // { dg-require-effective-target c++11 } |
| 5 | |
| 6 | struct A { |
| 7 | A() & = default; // { dg-error "constructor" } |
| 8 | ~A() & = default; // { dg-error "destructor" } |
| 9 | }; |
| 10 | |
| 11 | int main() |
| 12 | { |
| 13 | A a; |
| 14 | } |