================
@@ -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))
----------------
cor3ntin wrote:

do we have tests for `module` and `import` ? 
https://eel.is/c++draft/lex#tab:lex.name.special 

https://github.com/llvm/llvm-project/pull/218322
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to