[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / SemaCXX / crash-GH76228.cpp
blob33a9395823127ea4aae006e055d1ed76bf52aad6
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);
11 struct one_int {
12 int a;
14 struct bar : one_int, incomplete {};
15 // expected-error@-1 {{incomplete type}}
16 bar a2(0);
18 incomplete a3[3](1,2,3);
19 // expected-error@-1 {{incomplete type}}
21 struct qux : foo {
23 qux a4(0);
25 struct fred {
26 foo a[3];
28 fred a5(0);