Within a template, qualified name lookup can refer to a non-dependent type
that is not known to be a base class at template definition time due
to some dependent base class. Treat qualified name lookup that refers
to a non-static data member or function as implicit class member
access when the "this" type would be dependent.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85718 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaTemplate/instantiate-method.cpp b/test/SemaTemplate/instantiate-method.cpp
index f7c09ef..df1e1d9 100644
--- a/test/SemaTemplate/instantiate-method.cpp
+++ b/test/SemaTemplate/instantiate-method.cpp
@@ -81,3 +81,20 @@
   int *y0 = x0;
   int *y1 = x1; // expected-error{{initializing}}
 }
+
+struct X0Base {
+  int &f();
+};
+
+template<typename T>
+struct X0 : X0Base {
+};
+
+template<typename U>
+struct X1 : X0<U> {
+  int &f2() { return X0Base::f(); }
+};
+
+void test_X1(X1<int> x1i) {
+  int &ir = x1i.f2();
+}