summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseCXXInlineMethods.cpp
diff options
context:
space:
mode:
authorAlp Toker <alp@nuanti.com>2014-01-01 03:08:43 +0000
committerAlp Toker <alp@nuanti.com>2014-01-01 03:08:43 +0000
commit383d2c478cdd1f688a2e0d71a8867eef33316c0a (patch)
treef07c878376122ba66e754480a75c96c47672b693 /clang/lib/Parse/ParseCXXInlineMethods.cpp
parent3fec8c612e62d1bd458031ba309251e01b2a8b7c (diff)
downloadbcm5719-llvm-383d2c478cdd1f688a2e0d71a8867eef33316c0a.tar.gz
bcm5719-llvm-383d2c478cdd1f688a2e0d71a8867eef33316c0a.zip
ExpectAndConsume: Diagnose errors automatically
1) Teach ExpectAndConsume() to emit expected and expected-after diagnostics using the generic diagnostic descriptions added in r197972, eliminating another set of trivial err_expected_* variations while maintaining existing behaviour. 2) Lift SkipUntil() recovery out of ExpectAndConsume(). The Expect/Consume family of functions are primitive parser operations that now have the well-defined property of operating on single tokens. Factoring out recovery exposes opportunities for more consistent and tailored error recover at the call sites instead of just relying on a bottled SkipUntil formula. llvm-svn: 198270
Diffstat (limited to 'clang/lib/Parse/ParseCXXInlineMethods.cpp')
-rw-r--r--clang/lib/Parse/ParseCXXInlineMethods.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Parse/ParseCXXInlineMethods.cpp b/clang/lib/Parse/ParseCXXInlineMethods.cpp
index 95502143b0f..feff7fb724a 100644
--- a/clang/lib/Parse/ParseCXXInlineMethods.cpp
+++ b/clang/lib/Parse/ParseCXXInlineMethods.cpp
@@ -96,9 +96,9 @@ NamedDecl *Parser::ParseCXXInlineMethodDef(AccessSpecifier AS,
Diag(KWLoc, diag::err_default_delete_in_multiple_declaration)
<< Delete;
SkipUntil(tok::semi);
- } else {
- ExpectAndConsume(tok::semi, diag::err_expected_semi_after,
- Delete ? "delete" : "default", tok::semi);
+ } else if (ExpectAndConsume(tok::semi, diag::err_expected_after,
+ Delete ? "delete" : "default")) {
+ SkipUntil(tok::semi);
}
return FnD;
OpenPOWER on IntegriCloud