// RUN: %clang_cc1 -fms-extensions -fdelayed-template-parsing -fsyntax-only -verify -std=c++11 %s template class A { void foo() { undeclared(); } void foo2(); }; template class B { void foo4() { } // expected-note {{previous definition is here}} expected-note {{previous definition is here}} void foo4() { } // expected-error {{class member cannot be redeclared}} expected-error {{redefinition of 'foo4'}} void foo5() { } // expected-note {{previous definition is here}} friend void foo3() { undeclared(); } }; template void B::foo5() { // expected-error {{redefinition of 'foo5'}} } template void A::foo2() { undeclared(); } template void foo3() { undeclared(); } template void A::foo2(); void undeclared() { } template void foo5() {} //expected-note {{previous definition is here}} template void foo5() {} // expected-error {{redefinition of 'foo5'}} namespace Inner_Outer_same_template_param_name { template class Outmost { public: template class Inner { public: void f() { T* var; } }; }; } namespace PR11931 { template struct BindState; template<> struct BindState { static void Run() { } }; class Callback { public: typedef void RunType(); template Callback(BindState bind_state) { BindState::Run(); } }; Callback Bind() { return Callback(BindState()); } } namespace rdar11700604 { template void foo() = delete; struct X { X() = default; template void foo() = delete; }; } namespace PR17334 { template struct ArrayRef { constexpr ArrayRef() {} }; template void CreateConstInBoundsGEP2_32() { ArrayRef<> IdxList; } void LLVMBuildStructGEP() { CreateConstInBoundsGEP2_32(); } } namespace PR17661 { template constexpr T Fun(T A) { return T(0); } constexpr int Var = Fun(20); }