If x is an invalid field decl, don't construct an expression for P->x, 
just silently return an error to avoid bogus diagnostics.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64491 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Sema/exprs.c b/test/Sema/exprs.c
index db2daf1..4ddb976 100644
--- a/test/Sema/exprs.c
+++ b/test/Sema/exprs.c
@@ -57,3 +57,10 @@
   return R;
 }
 
+// PR3562
+void test10(int n,...) {
+  struct S {
+    double          a[n];  // expected-error {{fields must have a constant size}}
+  }               s;
+  double x = s.a[0];  // should not get another error here.
+}