Fix PR3001: if we have an error parsing an initializer, make sure to remove
the designator corresponding to it, otherwise Sema and later parsing will
get confused.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58603 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Sema/init.c b/test/Sema/init.c
index 9f91c42..a078a2a 100644
--- a/test/Sema/init.c
+++ b/test/Sema/init.c
@@ -67,3 +67,10 @@
            ((int)(&((struct sym_reg *)0)->nc_gpreg)) & 0,
            8 * ((int)(&((struct sym_reg *)0)->nc_gpreg))
 };
+
+// PR3001
+struct s1 s2 = {
+    .a = sizeof(struct s3), // expected-error {{invalid application of 'sizeof'}}
+    .b = bogus // expected-error {{use of undeclared identifier 'bogus'}}
+}
+