summaryrefslogtreecommitdiffstats
path: root/clang/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
commit89f13cb5bfdee00879d2904b56e8923f48f9d63f (patch)
tree1e3eb6a0b0ebee0d50c1f281c78b6d3d0a69a2d1 /clang/lib/Parse/Parser.cpp
parentd13c23c393698167ff185eb8eb71d5abd38b851d (diff)
downloadbcm5719-llvm-89f13cb5bfdee00879d2904b56e8923f48f9d63f.tar.gz
bcm5719-llvm-89f13cb5bfdee00879d2904b56e8923f48f9d63f.zip
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). llvm-svn: 154224
Diffstat (limited to 'clang/lib/Parse/Parser.cpp')
-rw-r--r--clang/lib/Parse/Parser.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Parse/Parser.cpp b/clang/lib/Parse/Parser.cpp
index dd339f53948..2c6dff35b27 100644
--- a/clang/lib/Parse/Parser.cpp
+++ b/clang/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;
OpenPOWER on IntegriCloud