Don't poke at an undefined class type of a field. Fixes PR7355.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106111 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaTemplate/instantiate-field.cpp b/test/SemaTemplate/instantiate-field.cpp
index a260635..d825cd7 100644
--- a/test/SemaTemplate/instantiate-field.cpp
+++ b/test/SemaTemplate/instantiate-field.cpp
@@ -81,3 +81,12 @@
     sort(x,x);
   }
 }
+
+namespace PR7355 {
+  template<typename T1> class A {
+    class D; // expected-note{{declared here}}
+    D d; //expected-error{{implicit instantiation of undefined member 'PR7355::A<int>::D'}}
+  };
+
+  A<int> ai; // expected-note{{in instantiation of}}
+}