// 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}} void foo4() { } // expected-error {{class member cannot be redeclared}} 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); } template auto invalidTrailingRetType() -> Bogus {} // expected-error {{unknown type name 'Bogus'}} namespace PR19613 { struct HeapTypeConfig { static void from_bitset(); }; template struct TypeImpl { struct BitsetType; static void Any() { BitsetType::New(); } }; template struct TypeImpl::BitsetType { static void New() { Config::from_bitset(); } }; static void f() { TypeImpl::Any(); } template struct S { template struct T; }; template template struct S::T { template struct U; template struct U { template static int f() { return sizeof(A) + sizeof(B) + sizeof(C) + sizeof(E); } }; }; static void g() { S::T::U::f(); } template struct SS { template struct X; template struct X; }; template template struct SS::X { static int f() { return sizeof(T) + sizeof(U); } }; static void h() { SS::X::f(); } }