aboutsummaryrefslogtreecommitdiff
path: root/test/SemaTemplate/class-template-spec.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaTemplate/class-template-spec.cpp')
-rw-r--r--test/SemaTemplate/class-template-spec.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/SemaTemplate/class-template-spec.cpp b/test/SemaTemplate/class-template-spec.cpp
index db6759814b..9347bf5997 100644
--- a/test/SemaTemplate/class-template-spec.cpp
+++ b/test/SemaTemplate/class-template-spec.cpp
@@ -29,3 +29,14 @@ template<> class A<float, FLOAT>;
template<> class A<FLOAT, float> { }; // expected-error{{redefinition}}
template<> class A<float, int> { }; // expected-error{{redefinition}}
+
+template<typename T, typename U = int> class X;
+
+template <> class X<int, int> { int foo(); }; // #1
+template <> class X<float> { int bar(); }; // #2
+
+typedef int int_type;
+void testme(X<int_type> *x1, X<float, int> *x2) {
+ x1->foo(); // okay: refers to #1
+ x2->bar(); // okay: refers to #2
+}