| 1 |
// PR c++/118304 |
| 2 |
// { dg-do "compile" { target c++11 } } |
| 3 |
|
| 4 |
// Constructors. |
| 5 |
struct A { |
| 6 |
*A () = default; // { dg-error "return type specification" } |
| 7 |
}; |
| 8 |
struct B { |
| 9 |
int* B () = default; // { dg-error "return type specification" } |
| 10 |
}; |
| 11 |
struct C { |
| 12 |
const int& C () = default; // { dg-error "return type specification" } |
| 13 |
}; |
| 14 |
struct D { |
| 15 |
**D () = default; // { dg-error "return type specification" } |
| 16 |
}; |
| 17 |
struct E { |
| 18 |
&E () = default; // { dg-error "return type specification|reference to" } |
| 19 |
}; |
| 20 |
struct F { |
| 21 |
*&F () = default; // { dg-error "return type specification|reference to" } |
| 22 |
}; |
| 23 |
struct G { |
| 24 |
**&G () = default; // { dg-error "return type specification|reference to" } |
| 25 |
}; |
| 26 |
struct H { |
| 27 |
*H (const H&) = default; // { dg-error "return type specification" } |
| 28 |
}; |
| 29 |
struct I { |
| 30 |
**I (const I&) = default; // { dg-error "return type specification" } |
| 31 |
}; |
| 32 |
struct J { |
| 33 |
&J (const J&) = default; // { dg-error "return type specification|reference to" } |
| 34 |
}; |
| 35 |
struct K { |
| 36 |
const K() = default; // { dg-error "expected unqualified-id" } |
| 37 |
}; |
| 38 |
|
| 39 |
// Destructors. |
| 40 |
struct L { |
| 41 |
* ~L () = default; // { dg-error "return type specification" } |
| 42 |
}; |
| 43 |
struct M { |
| 44 |
** ~M () = default; // { dg-error "return type specification" } |
| 45 |
}; |
| 46 |
struct N { |
| 47 |
& ~N () = default; // { dg-error "return type specification|reference to" } |
| 48 |
}; |