]> granicus.if.org Git - clang/commitdiff
Add regression test for PR12331.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 2 Jul 2013 18:08:50 +0000 (18:08 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 2 Jul 2013 18:08:50 +0000 (18:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185453 91177308-0d34-0410-b5e6-96231b3b80d8

test/SemaTemplate/explicit-specialization-member.cpp

index 7fe6bf37d7528a3ddd225af2808bff459f615a17..9ddbc04953d3cdb4b020047bb0fddf5ef4cc7242 100644 (file)
@@ -19,3 +19,12 @@ namespace PR6161 {
   };
   numpunct<char>::~numpunct(); // expected-error{{expected the class name after '~' to name a destructor}}
 }
+
+namespace PR12331 {
+  template<typename T> 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<int>::U { static const int n = sizeof(int); }; // expected-error {{explicit specialization of 'U' after instantiation}}
+}