1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 // Don't crash (PR18284).
3
4 namespace n1 {
5 class A { };
6 class C { A a; };
7
RunTest()8 A::RunTest() {} // expected-error {{C++ requires a type specifier for all declarations}}
9
f()10 void f() {
11 new C;
12 }
13 } // namespace n1
14
15 namespace n2 {
16 class A { };
17 class C : public A { };
18
RunTest()19 A::RunTest() {} // expected-error {{C++ requires a type specifier for all declarations}}
20
f()21 void f() {
22 new C;
23 }
24 } // namespace n2
25