================
@@ -213,7 +215,11 @@ static MacroDiag shouldWarnOnMacroDef(Preprocessor &PP,
IdentifierInfo *II) {
static MacroDiag shouldWarnOnMacroUndef(Preprocessor &PP, IdentifierInfo *II) {
const LangOptions &Lang = PP.getLangOpts();
- // Do not warn on keyword undef. It is generally harmless and widely used.
+ StringRef Text = II->getName();
+ if (II->isKeyword(Lang))
+ return MD_KeywordUnDef;
+ if (Lang.CPlusPlus11 && (Text == "override" || Text == "final"))
+ return MD_KeywordUnDef;
if (isReservedInAllContexts(II->isReserved(Lang)))
return MD_ReservedMacro;
if (isReservedCXXAttributeName(PP, II))
----------------
yronglin wrote:
Hmm, yes, I think we need more precise control to reduce interference with
users.
https://github.com/llvm/llvm-project/pull/218322
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits