diff options
author | David Blaikie <dblaikie@gmail.com> | 2012-04-06 23:33:59 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2012-04-06 23:33:59 +0000 |
commit | b031eab1c07fa2c5bd74c7e92f7c938bf3304729 (patch) | |
tree | 9630656102ee5b63b022059ce74aaad4b39b0860 /lib/Parse/ParseTemplate.cpp | |
parent | f7ef931a15b4954a1bb546b8e903d08758b371d9 (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/ParseTemplate.cpp')
-rw-r--r-- | lib/Parse/ParseTemplate.cpp | 7 |
1 files changed, 1 insertions, 6 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; } |