// RUN: %clang_cc1 -fsyntax-only -verify %s // Test class template partial specializations of member templates. template struct X0 { template struct Inner0 { static const unsigned value = 0; }; template struct Inner0 { static const unsigned value = 1; }; }; template template struct X0::Inner0 { static const unsigned value = 2; }; int array0[X0::Inner0::value == 0? 1 : -1]; int array1[X0::Inner0::value == 1? 1 : -1]; int array2[X0::Inner0::value == 2? 1 : -1]; // Make sure we can provide out-of-line class template partial specializations // for member templates (and instantiate them). template struct A { struct C { template struct B; }; }; // partial specialization of A::C::B template template struct A::C::B { }; A::C::B absip; // Check for conflicts during template instantiation. template struct Outer { template struct Inner; template struct Inner {}; // expected-note{{previous}} template struct Inner {}; // expected-error{{cannot be redeclared}} }; Outer outer; // expected-note{{instantiation}} // Test specialization of class template partial specialization members. template<> template struct X0::Inner0 { static const unsigned value = 3; }; int array3[X0::Inner0::value == 0? 1 : -1]; int array4[X0::Inner0::value == 3? 1 : -1]; int array5[X0::Inner0::value == 2? 1 : -1]; namespace rdar8651930 { template struct Outer { template struct Inner; template struct Inner { static const bool value = true; }; template struct Inner { static const bool value = false; }; }; int array0[Outer::Inner::value? 1 : -1]; int array1[Outer::Inner::value? -1 : 1]; }