From: Richard Smith Date: Tue, 2 Jul 2013 18:08:50 +0000 (+0000) Subject: Add regression test for PR12331. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=21383febfcc27c3aead61ecb74be6641cc7c0a04;p=clang Add regression test for PR12331. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185453 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/SemaTemplate/explicit-specialization-member.cpp b/test/SemaTemplate/explicit-specialization-member.cpp index 7fe6bf37d7..9ddbc04953 100644 --- a/test/SemaTemplate/explicit-specialization-member.cpp +++ b/test/SemaTemplate/explicit-specialization-member.cpp @@ -19,3 +19,12 @@ namespace PR6161 { }; numpunct::~numpunct(); // expected-error{{expected the class name after '~' to name a destructor}} } + +namespace PR12331 { + template struct S { + struct U { static const int n = 5; }; + enum E { e = U::n }; // expected-note {{implicit instantiation first required here}} + int arr[e]; + }; + template<> struct S::U { static const int n = sizeof(int); }; // expected-error {{explicit specialization of 'U' after instantiation}} +}