Provide a proper source location when building an implicit dereference. Fixes PR3600

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64993 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaTemplate/class-template-spec.cpp b/test/SemaTemplate/class-template-spec.cpp
index db67598..9347bf5 100644
--- a/test/SemaTemplate/class-template-spec.cpp
+++ b/test/SemaTemplate/class-template-spec.cpp
@@ -29,3 +29,14 @@
 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
+}