summaryrefslogtreecommitdiffstats
path: root/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
commitca70f4fa1c4eae6a47c97c773b8e63803a43a90c (patch)
treee361f7a66b24b68f25f623c13b24ff90e0ac56f1 /lib/Parse/ParseCXXInlineMethods.cpp
parentf1c0e483721aca10816403cc91f03ed5db876a98 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198270 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseCXXInlineMethods.cpp')
-rw-r--r--lib/Parse/ParseCXXInlineMethods.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Parse/ParseCXXInlineMethods.cpp b/lib/Parse/ParseCXXInlineMethods.cpp
index 95502143b0..feff7fb724 100644
--- a/lib/Parse/ParseCXXInlineMethods.cpp
+++ b/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;