aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Parse/ParseTemplate.cpp7
-rw-r--r--lib/Parse/Parser.cpp6
2 files changed, 4 insertions, 9 deletions
diff --git a/lib/Parse/ParseTemplate.cpp b/lib/Parse/ParseTemplate.cpp
index b7cc862b4d..9d5c62567e 100644
--- a/lib/Parse/ParseTemplate.cpp
+++ b/lib/Parse/ParseTemplate.cpp
@@ -638,12 +638,7 @@ Parser::ParseNonTypeTemplateParameter(unsigned Depth, unsigned Position) {
Declarator ParamDecl(DS, Declarator::TemplateParamContext);
ParseDeclarator(ParamDecl);
if (DS.getTypeSpecType() == DeclSpec::TST_unspecified) {
- // This probably shouldn't happen - and it's more of a Sema thing, but
- // basically we didn't parse the type name because we couldn't associate
- // it with an AST node. we should just skip to the comma or greater.
- // TODO: This is currently a placeholder for some kind of Sema Error.
- Diag(Tok.getLocation(), diag::err_parse_error);
- SkipUntil(tok::comma, tok::greater, true, true);
+ Diag(Tok.getLocation(), diag::err_expected_template_parameter);
return 0;
}
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;