| 1 |
// Core DR 1604/1571/1572 |
| 2 |
// { dg-require-effective-target c++11 } |
| 3 |
|
| 4 |
struct Banana { }; |
| 5 |
struct Enigma { operator const Banana(); }; |
| 6 |
struct Doof { operator Banana&(); }; |
| 7 |
void enigmatic() { |
| 8 |
typedef const Banana ConstBanana; |
| 9 |
Banana &&banana1 = ConstBanana(); // { dg-error "" } |
| 10 |
Banana &&banana2 = Enigma(); // { dg-error "" } |
| 11 |
Banana &&banana3 = Doof(); // { dg-error "" } |
| 12 |
} |
| 13 |
|
| 14 |
class A { |
| 15 |
public: |
| 16 |
operator volatile int &(); |
| 17 |
}; |
| 18 |
A a; |
| 19 |
|
| 20 |
const int & ir1a = a.operator volatile int&(); // { dg-error "" } |
| 21 |
const int & ir2a = a; // { dg-error "" } |
| 22 |
|
| 23 |
struct X { |
| 24 |
operator int&(); |
| 25 |
} x; |
| 26 |
int&& rri2 = X(); // { dg-error "" } |