summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/Parse/ParseInit.cpp2
-rw-r--r--clang/test/Parser/recovery-1.c9
2 files changed, 10 insertions, 1 deletions
diff --git a/clang/Parse/ParseInit.cpp b/clang/Parse/ParseInit.cpp
index 63687408d72..c4ecd26f1b8 100644
--- a/clang/Parse/ParseInit.cpp
+++ b/clang/Parse/ParseInit.cpp
@@ -175,7 +175,7 @@ Parser::ExprResult Parser::ParseInitializer() {
// If we couldn't parse the subelement, bail out.
if (SubElt.isInvalid) {
InitExprsOk = false;
- SkipUntil(tok::r_brace);
+ SkipUntil(tok::r_brace, false, true);
break;
} else
InitExprs.push_back(SubElt.Val);
diff --git a/clang/test/Parser/recovery-1.c b/clang/test/Parser/recovery-1.c
index b37c88cba07..b7270b572a9 100644
--- a/clang/test/Parser/recovery-1.c
+++ b/clang/test/Parser/recovery-1.c
@@ -5,3 +5,12 @@ char (((( /* expected-error {{to match this '('}} */
*X x ] )))); /* expected-error {{expected ')'}} */
; // expected-warning {{ISO C does not allow an extra ';' outside of a function}}
+
+
+
+
+struct S { void *X, *Y; };
+
+struct S A = {
+ &BADIDENT, 0 /* expected-error {{use of undeclared identifier}} */
+};
OpenPOWER on IntegriCloud