Tweak error recovery for missing semicolon after decl. For this:
void foo() {
int x
if (x) {
}
}
We now emit:
a.c:5:3: error: parse error
if (x) {
^
1 diagnostic generated.
instead of:
a.c:5:3: error: parse error
if (x) {
^
a.c:9:1: error: expected '}'
^
2 diagnostics generated.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41243 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Parse/ParseDecl.cpp b/Parse/ParseDecl.cpp
index 6254563..d4017bb 100644
--- a/Parse/ParseDecl.cpp
+++ b/Parse/ParseDecl.cpp
@@ -281,7 +281,7 @@
Diag(Tok, diag::err_parse_error);
// Skip to end of block or statement
- SkipUntil(tok::r_brace, true);
+ SkipUntil(tok::r_brace, true, true);
if (Tok.getKind() == tok::semi)
ConsumeToken();
return 0;