| 1 |
// RUN: %clang_cc1 -std=c++20 -verify %s |
| 2 |
// Check we don't crash on incomplete members and bases when handling parenthesized initialization. |
| 3 |
class incomplete; // expected-note@-0 3 {{forward declaration of 'incomplete'}} |
| 4 |
struct foo { |
| 5 |
int a; |
| 6 |
incomplete b; |
| 7 |
// expected-error@-1 {{incomplete type}} |
| 8 |
}; |
| 9 |
foo a1(0); |
| 10 |
|
| 11 |
struct one_int { |
| 12 |
int a; |
| 13 |
}; |
| 14 |
struct bar : one_int, incomplete {}; |
| 15 |
// expected-error@-1 {{incomplete type}} |
| 16 |
bar a2(0); |
| 17 |
|
| 18 |
incomplete a3[3](1,2,3); |
| 19 |
// expected-error@-1 {{incomplete type}} |
| 20 |
|
| 21 |
struct qux : foo { |
| 22 |
}; |
| 23 |
qux a4(0); |
| 24 |
|
| 25 |
struct fred { |
| 26 |
foo a[3]; |
| 27 |
}; |
| 28 |
fred a5(0); |