summaryrefslogtreecommitdiffstats
path: root/test/SemaTemplate/explicit-specialization-member.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaTemplate/explicit-specialization-member.cpp')
-rw-r--r--test/SemaTemplate/explicit-specialization-member.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/SemaTemplate/explicit-specialization-member.cpp b/test/SemaTemplate/explicit-specialization-member.cpp
index 7fe6bf3..07d7389 100644
--- a/test/SemaTemplate/explicit-specialization-member.cpp
+++ b/test/SemaTemplate/explicit-specialization-member.cpp
@@ -19,3 +19,31 @@ 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}}
+}
+
+namespace PR18246 {
+ template<typename T>
+ class Baz {
+ public:
+ template<int N> void bar();
+ };
+
+ template<typename T>
+ template<int N>
+ void Baz<T>::bar() {
+ }
+
+ // FIXME: Don't suggest the 'template<>' correction here, because this cannot
+ // be an explicit specialization.
+ template<typename T>
+ void Baz<T>::bar<0>() { // expected-error {{requires 'template<>'}}
+ }
+}
OpenPOWER on IntegriCloud