diff --git a/clang/include/clang/Basic/DiagnosticLexKinds.td b/clang/include/clang/Basic/DiagnosticLexKinds.td index 417187222e448..e9339f473c67a 100644 --- a/clang/include/clang/Basic/DiagnosticLexKinds.td +++ b/clang/include/clang/Basic/DiagnosticLexKinds.td @@ -396,7 +396,7 @@ def pp_out_of_date_dependency : Warning< "current file is older than dependency %0">; def ext_pp_undef_builtin_macro : ExtWarn<"undefining builtin macro">, InGroup; -def ext_pp_redef_builtin_macro : ExtWarn<"redefining builtin macro">, +def ext_pp_redef_builtin_macro : ExtWarn<"redefining builtin macro '%0'">, InGroup; def pp_disabled_macro_expansion : Warning< "disabled expansion of recursive macro">, DefaultIgnore, diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp index 891c8ab7f3155..38780f4fc9a89 100644 --- a/clang/lib/Lex/PPDirectives.cpp +++ b/clang/lib/Lex/PPDirectives.cpp @@ -3289,7 +3289,7 @@ void Preprocessor::HandleDefineDirective( // Warn if defining "__LINE__" and other builtins, per C99 6.10.8/4 and // C++ [cpp.predefined]p4, but allow it as an extension. if (isLanguageDefinedBuiltin(SourceMgr, OtherMI, II->getName())) - Diag(MacroNameTok, diag::ext_pp_redef_builtin_macro); + Diag(MacroNameTok, diag::ext_pp_redef_builtin_macro) << MacroNameTok.getIdentifierInfo(); // inserting this diagonstic message into stream. // Macros must be identical. This means all tokens and whitespace // separation must be the same. C99 6.10.3p2. else if (!OtherMI->isAllowRedefinitionsWithoutWarning() && @@ -3354,7 +3354,7 @@ void Preprocessor::HandleUndefDirective() { // Warn if undefining "__LINE__" and other builtins, per C99 6.10.8/4 and // C++ [cpp.predefined]p4, but allow it as an extension. if (isLanguageDefinedBuiltin(SourceMgr, MI, II->getName())) - Diag(MacroNameTok, diag::ext_pp_undef_builtin_macro); + Diag(MacroNameTok, diag::ext_pp_undef_builtin_macro) << MacroNameTok.getIdentifierInfo(); // inserting this diagnostic message into it if (MI->isWarnIfUnused()) WarnUnusedMacroLocs.erase(MI->getDefinitionLoc());