// RUN: clang-cc -fsyntax-only -verify %s namespace N { namespace M { template struct Promote; // expected-note{{previous definition is here}} template<> struct Promote { typedef int type; }; template<> struct Promote { typedef int type; }; template<> struct Promote { typedef double type; }; Promote::type *ret_intptr(int* ip) { return ip; } Promote::type *ret_intptr2(int* ip) { return ip; } } M::Promote::type *ret_intptr3(int* ip) { return ip; } M::template Promote::type *ret_intptr4(int* ip) { return ip; } } N::M::Promote::type *ret_intptr5(int* ip) { return ip; } ::N::M::Promote::type *ret_intptr6(int* ip) { return ip; } N::M::template; // expected-error{{expected template name after 'template' keyword in nested name specifier}} \ // expected-error{{expected unqualified-id}} N::M::template Promote; // expected-error{{expected '<' after 'template Promote' in nested name specifier}} \ // expected-error{{C++ requires a type specifier for all declarations}} \ // expected-error{{redefinition of 'Promote' as different kind of symbol}} namespace N { template struct A; template<> struct A { struct X; }; } struct ::N::A::X { int foo; };