diff options
| author | Craig Topper <craig.topper@gmail.com> | 2015-11-14 18:16:08 +0000 |
|---|---|---|
| committer | Craig Topper <craig.topper@gmail.com> | 2015-11-14 18:16:08 +0000 |
| commit | 54a6a68c706b7afb88da0389977de8287ae6478e (patch) | |
| tree | f6b3017334a3d736ae6ad9d2ff0414480c9440a0 /clang/lib/Parse | |
| parent | 3110a5cb937395b7dae8311ca15934aaacd5520c (diff) | |
| download | bcm5719-llvm-54a6a68c706b7afb88da0389977de8287ae6478e.tar.gz bcm5719-llvm-54a6a68c706b7afb88da0389977de8287ae6478e.zip | |
Merge some similar diagnostics using %select.
llvm-svn: 253136
Diffstat (limited to 'clang/lib/Parse')
| -rw-r--r-- | clang/lib/Parse/ParseCXXInlineMethods.cpp | 10 | ||||
| -rw-r--r-- | clang/lib/Parse/ParseDecl.cpp | 9 | ||||
| -rw-r--r-- | clang/lib/Parse/ParseDeclCXX.cpp | 8 | ||||
| -rw-r--r-- | clang/lib/Parse/Parser.cpp | 10 |
4 files changed, 21 insertions, 16 deletions
diff --git a/clang/lib/Parse/ParseCXXInlineMethods.cpp b/clang/lib/Parse/ParseCXXInlineMethods.cpp index ab1f97d31a6..e536644d5bf 100644 --- a/clang/lib/Parse/ParseCXXInlineMethods.cpp +++ b/clang/lib/Parse/ParseCXXInlineMethods.cpp @@ -67,8 +67,9 @@ NamedDecl *Parser::ParseCXXInlineMethodDef(AccessSpecifier AS, SourceLocation KWEndLoc = Tok.getEndLoc().getLocWithOffset(-1); if (TryConsumeToken(tok::kw_delete, KWLoc)) { Diag(KWLoc, getLangOpts().CPlusPlus11 - ? diag::warn_cxx98_compat_deleted_function - : diag::ext_deleted_function); + ? diag::warn_cxx98_compat_defaulted_deleted_function + : diag::ext_defaulted_deleted_function) + << 1 /* deleted */; Actions.SetDeclDeleted(FnD, KWLoc); Delete = true; if (auto *DeclAsFunction = dyn_cast<FunctionDecl>(FnD)) { @@ -76,8 +77,9 @@ NamedDecl *Parser::ParseCXXInlineMethodDef(AccessSpecifier AS, } } else if (TryConsumeToken(tok::kw_default, KWLoc)) { Diag(KWLoc, getLangOpts().CPlusPlus11 - ? diag::warn_cxx98_compat_defaulted_function - : diag::ext_defaulted_function); + ? diag::warn_cxx98_compat_defaulted_deleted_function + : diag::ext_defaulted_deleted_function) + << 0 /* defaulted */; Actions.SetDeclDefaulted(FnD, KWLoc); if (auto *DeclAsFunction = dyn_cast<FunctionDecl>(FnD)) { DeclAsFunction->setRangeEnd(KWEndLoc); diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index 499926a0796..4f713b70a50 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -2785,8 +2785,8 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS, // arguments. Complain, then parse it as a type as the user // intended. Diag(TemplateId->TemplateNameLoc, - diag::err_out_of_line_template_id_names_constructor) - << TemplateId->Name; + diag::err_out_of_line_template_id_type_names_constructor) + << TemplateId->Name << 0 /* template name */; } DS.getTypeSpecScope() = SS; @@ -2831,8 +2831,9 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS, // looked at the declarator, and the user probably meant this // to be a type. Complain that it isn't supposed to be treated // as a type, then proceed to parse it as a type. - Diag(Next.getLocation(), diag::err_out_of_line_type_names_constructor) - << Next.getIdentifierInfo(); + Diag(Next.getLocation(), + diag::err_out_of_line_template_id_type_names_constructor) + << Next.getIdentifierInfo() << 1 /* type */; } ParsedType TypeRep = Actions.getTypeName(*Next.getIdentifierInfo(), diff --git a/clang/lib/Parse/ParseDeclCXX.cpp b/clang/lib/Parse/ParseDeclCXX.cpp index eeab3976757..05a75d26ecd 100644 --- a/clang/lib/Parse/ParseDeclCXX.cpp +++ b/clang/lib/Parse/ParseDeclCXX.cpp @@ -394,8 +394,8 @@ Decl *Parser::ParseUsingDirectiveOrDeclaration(unsigned Context, // Template parameters are always an error here. if (TemplateInfo.Kind) { SourceRange R = TemplateInfo.getSourceRange(); - Diag(UsingLoc, diag::err_templated_using_directive) - << R << FixItHint::CreateRemoval(R); + Diag(UsingLoc, diag::err_templated_using_directive_declaration) + << 0 /* directive */ << R << FixItHint::CreateRemoval(R); } return ParseUsingDirective(Context, UsingLoc, DeclEnd, attrs); @@ -645,8 +645,8 @@ Decl *Parser::ParseUsingDeclaration(unsigned Context, // template <...> using id = type; if (TemplateInfo.Kind && !IsAliasDecl) { SourceRange R = TemplateInfo.getSourceRange(); - Diag(UsingLoc, diag::err_templated_using_declaration) - << R << FixItHint::CreateRemoval(R); + Diag(UsingLoc, diag::err_templated_using_directive_declaration) + << 1 /* declaration */ << R << FixItHint::CreateRemoval(R); // Unfortunately, we have to bail out instead of recovering by // ignoring the parameters, just in case the nested name specifier diff --git a/clang/lib/Parse/Parser.cpp b/clang/lib/Parse/Parser.cpp index 26dc3998ad8..b3eeb9d58ff 100644 --- a/clang/lib/Parse/Parser.cpp +++ b/clang/lib/Parse/Parser.cpp @@ -1094,14 +1094,16 @@ Decl *Parser::ParseFunctionDefinition(ParsingDeclarator &D, SourceLocation KWLoc; if (TryConsumeToken(tok::kw_delete, KWLoc)) { Diag(KWLoc, getLangOpts().CPlusPlus11 - ? diag::warn_cxx98_compat_deleted_function - : diag::ext_deleted_function); + ? diag::warn_cxx98_compat_defaulted_deleted_function + : diag::ext_defaulted_deleted_function) + << 1 /* deleted */; Actions.SetDeclDeleted(Res, KWLoc); Delete = true; } else if (TryConsumeToken(tok::kw_default, KWLoc)) { Diag(KWLoc, getLangOpts().CPlusPlus11 - ? diag::warn_cxx98_compat_defaulted_function - : diag::ext_defaulted_function); + ? diag::warn_cxx98_compat_defaulted_deleted_function + : diag::ext_defaulted_deleted_function) + << 0 /* defaulted */; Actions.SetDeclDefaulted(Res, KWLoc); } else { llvm_unreachable("function definition after = not 'delete' or 'default'"); |

