Require the object type of a member access expression ("." or "->") to
be complete.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89042 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaTemplate/member-function-template.cpp b/test/SemaTemplate/member-function-template.cpp
index 756b510..1d46d31 100644
--- a/test/SemaTemplate/member-function-template.cpp
+++ b/test/SemaTemplate/member-function-template.cpp
@@ -60,3 +60,16 @@
 void test_Functor(Functor f) {
   f(1);
 }
+
+// Instantiation on ->
+template<typename T>
+struct X1 {
+  template<typename U> U& get();
+};
+
+template<typename T> struct X2; // expected-note{{here}}
+
+void test_incomplete_access(X1<int> *x1, X2<int> *x2) {
+  float &fr = x1->get<float>();
+  (void)x2->get<float>(); // expected-error{{implicit instantiation of undefined template}}
+}