From: Douglas Gregor Date: Thu, 8 Oct 2009 15:27:05 +0000 (+0000) Subject: More testing for explicit specializations of member class templates X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=42887b9224e1d47372fb8a00cba27c925924fa52;p=clang More testing for explicit specializations of member class templates git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83548 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/CXX/temp/temp.spec/temp.expl.spec/p2.cpp b/test/CXX/temp/temp.spec/temp.expl.spec/p2.cpp index 0ba95d875a..9c6c5edc50 100644 --- a/test/CXX/temp/temp.spec/temp.expl.spec/p2.cpp +++ b/test/CXX/temp/temp.spec/temp.expl.spec/p2.cpp @@ -58,7 +58,8 @@ struct X0 { // expected-note 2{{here}} struct Inner : public T { }; // expected-note 3{{here}} template - struct InnerTemplate : public T { }; + struct InnerTemplate : public T { }; // expected-note 2{{explicitly specialized}} \ + // expected-error{{base specifier}} template void ft1(T t, U u); @@ -170,15 +171,40 @@ N0::X0::Inner inner2; N0::X0::Inner inner3; N0::X0::Inner inner4; // expected-error{{incomplete}} -#if 0 -// FIXME: update the remainder of this test to check for scopes properly. // -- member class template of a class template -template<> -template<> -struct X0::InnerTemplate { }; +namespace N0 { + template<> + template<> + struct X0::InnerTemplate { }; + + template<> template<> + struct X0::InnerTemplate; // expected-note{{forward declaration}} + + template<> template<> + struct X0::InnerTemplate; -X0::InnerTemplate inner_template0; + template<> template<> + struct X0::InnerTemplate; +} + +template<> template<> +struct N0::X0::InnerTemplate { }; // okay + +template<> template<> +struct N0::X0::InnerTemplate { }; // expected-error{{class template specialization}} +namespace N1 { + template<> template<> + struct N0::X0::InnerTemplate { }; // expected-error{{enclosing}} +} + +N0::X0::InnerTemplate inner_template0; +N0::X0::InnerTemplate inner_template1; // expected-error{{incomplete}} +N0::X0::InnerTemplate inner_template2; +N0::X0::InnerTemplate inner_template3; // expected-note{{instantiation}} + +#if 0 +// FIXME: update the remainder of this test to check for scopes properly. // -- member function template of a class template template<> template<>