aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/Parser.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2012-04-06 23:33:59 +0000
committerDavid Blaikie <dblaikie@gmail.com>2012-04-06 23:33:59 +0000
commitb031eab1c07fa2c5bd74c7e92f7c938bf3304729 (patch)
tree9630656102ee5b63b022059ce74aaad4b39b0860 /lib/Parse/Parser.cpp
parentf7ef931a15b4954a1bb546b8e903d08758b371d9 (diff)
Remove "parse error" in favor of more descriptive diagnostics.
In a few cases clang emitted a rather content-free diagnostic: 'parse error'. This change replaces two actual cases (template parameter parsing and K&R parameter declaration parsing) with more specific diagnostics and removes a third dead case of this in the BalancedDelimiterTracker (the ctor already checked the invariant necessary to ensure that the diag::parse_error was never actually used). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154224 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/Parser.cpp')
-rw-r--r--lib/Parse/Parser.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Parse/Parser.cpp b/lib/Parse/Parser.cpp
index dd339f5394..2c6dff35b2 100644
--- a/lib/Parse/Parser.cpp
+++ b/lib/Parse/Parser.cpp
@@ -1111,7 +1111,7 @@ void Parser::ParseKNRParamDeclarations(Declarator &D) {
if (Tok.is(tok::semi)) {
ConsumeToken();
} else {
- Diag(Tok, diag::err_parse_error);
+ Diag(Tok, diag::err_expected_semi_declaration);
// Skip to end of block or statement
SkipUntil(tok::semi, true);
if (Tok.is(tok::semi))
@@ -1681,9 +1681,9 @@ bool Parser::BalancedDelimiterTracker::diagnoseMissingClose() {
assert(!P.Tok.is(Close) && "Should have consumed closing delimiter");
const char *LHSName = "unknown";
- diag::kind DID = diag::err_parse_error;
+ diag::kind DID;
switch (Close) {
- default: break;
+ default: llvm_unreachable("Unexpected balanced token");
case tok::r_paren : LHSName = "("; DID = diag::err_expected_rparen; break;
case tok::r_brace : LHSName = "{"; DID = diag::err_expected_rbrace; break;
case tok::r_square: LHSName = "["; DID = diag::err_expected_rsquare; break;