| 1 |
// { dg-do compile { target c++14 } } |
| 2 |
|
| 3 |
// pr c++/66443 a synthesized ctor of an abstract class that's deleted |
| 4 |
// only because of virtual base construction doesn't stop a derived |
| 5 |
// class using it as a base object constructor (provided it has a |
| 6 |
// suitable ctor invocation of the virtual base). |
| 7 |
|
| 8 |
// However we should still complain if the intermediate base is a |
| 9 |
// non-abstract type. |
| 10 |
|
| 11 |
static int a_made; |
| 12 |
|
| 13 |
struct A { |
| 14 |
A *m_a = this; |
| 15 |
A (int) { a_made++; } |
| 16 |
}; |
| 17 |
|
| 18 |
struct B : virtual A { // { dg-error "no matching function" } |
| 19 |
A *m_b = this; |
| 20 |
virtual bool Ok (); // not abstract |
| 21 |
}; |
| 22 |
|
| 23 |
bool B::Ok () |
| 24 |
{ |
| 25 |
return false; |
| 26 |
} |
| 27 |
|
| 28 |
|
| 29 |
B b; // { dg-error "deleted" } |