[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / SemaCXX / pr18284-crash-on-invalid.cpp
blobc6e877b0ee622233b55c91bda65feb6e8919058d
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 // Don't crash (PR18284).
4 namespace n1 {
5 class A { };
6 class C { A a; };
8 A::RunTest() {} // expected-error {{a type specifier is required for all declarations}}
10 void f() {
11 new C;
13 } // namespace n1
15 namespace n2 {
16 class A { };
17 class C : public A { };
19 A::RunTest() {} // expected-error {{a type specifier is required for all declarations}}
21 void f() {
22 new C;
24 } // namespace n2