| 1 |
// { dg-do compile { target c++11 } } |
| 2 |
|
| 3 |
struct A { |
| 4 |
int i, j; |
| 5 |
A () : A(0), j(0) { } // { dg-error "constructor delegation" } |
| 6 |
A (int _i) : i(_i) { } |
| 7 |
}; |
| 8 |
|
| 9 |
struct B { |
| 10 |
int i, j; |
| 11 |
B () : i(0), B(0) { } // { dg-error "constructor delegation" } |
| 12 |
B (int _j) : j(_j) { } |
| 13 |
|
| 14 |
}; |
| 15 |
|
| 16 |
struct C {}; |
| 17 |
|
| 18 |
struct D : public C { |
| 19 |
D () : C() { } |
| 20 |
D (float) : D(), C() { } // { dg-error "constructor delegation" } |
| 21 |
D (float, float): C(), D() { } // { dg-error "constructor delegation" } |
| 22 |
}; |