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