summaryrefslogtreecommitdiffstats
path: root/test/SemaTemplate/instantiate-partial-spec.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaTemplate/instantiate-partial-spec.cpp')
-rw-r--r--test/SemaTemplate/instantiate-partial-spec.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/SemaTemplate/instantiate-partial-spec.cpp b/test/SemaTemplate/instantiate-partial-spec.cpp
new file mode 100644
index 0000000..1e820e4
--- /dev/null
+++ b/test/SemaTemplate/instantiate-partial-spec.cpp
@@ -0,0 +1,23 @@
+// RUN: %clang_cc1 -std=c++1y -verify %s
+// expected-no-diagnostics
+
+template<typename T> struct A {
+ template<typename U> struct B;
+ template<typename U> struct B<U*>;
+};
+template<typename T> template<typename U> struct A<T>::B<U*> {};
+template struct A<int>;
+A<int>::B<int*> b;
+
+
+template<typename T> struct B {
+ template<typename U> static const int var1;
+ template<typename U> static const int var1<U*>;
+
+ template<typename U> static const int var2;
+};
+template<typename T> template<typename U> const int B<T>::var1<U*> = 1;
+template<typename T> template<typename U> const int B<T>::var2<U*> = 1;
+template struct B<int>;
+int b_test1[B<int>::var1<int*>];
+int b_test2[B<int>::var2<int*>];
OpenPOWER on IntegriCloud