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

llvm-svn: 89042
diff --git a/clang/test/SemaTemplate/class-template-spec.cpp b/clang/test/SemaTemplate/class-template-spec.cpp
index 5bc9a6c..2808404 100644
--- a/clang/test/SemaTemplate/class-template-spec.cpp
+++ b/clang/test/SemaTemplate/class-template-spec.cpp
@@ -19,7 +19,7 @@
 int test_incomplete_specs(A<double, double> *a1, 
                           A<double> *a2)
 {
-  (void)a1->x; // expected-error{{incomplete definition of type 'A<double, double>'}}
+  (void)a1->x; // expected-error{{member access into incomplete type}}
   (void)a2->x; // expected-error{{implicit instantiation of undefined template 'struct A<double, int>'}}
 }
 
diff --git a/clang/test/SemaTemplate/member-function-template.cpp b/clang/test/SemaTemplate/member-function-template.cpp
index 756b510..1d46d31 100644
--- a/clang/test/SemaTemplate/member-function-template.cpp
+++ b/clang/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}}
+}