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