================
@@ -1362,20 +1368,30 @@ void Preprocessor::HandleDirective(Token &Result) {
       case tok::pp_module:
       case tok::pp___preprocessed_module:
       case tok::pp___preprocessed_import:
-        Diag(Result, diag::err_embedded_directive)
-            << (getLangOpts().CPlusPlusModules &&
-                Introducer.isModuleContextualKeyword(
-                    /*AllowExport=*/false))
-            << II->getName();
-        Diag(*ArgMacro, diag::note_macro_expansion_here)
-            << ArgMacro->getIdentifierInfo();
-        DiscardUntilEndOfDirective();
-        return;
+        return true;
       default:
-        break;
+        return false;
       }
+    };
+
+    // [cpp.replace.general] makes any embedded directive ill-formed in
+    // C++26; in earlier modes the construct is undefined behavior and only
+    // pedantically warned about.
+    const bool IsError = LangOpts.CPlusPlus26 ||
+                         (II && IsAlwaysUnsupported(II->getPPKeywordID()));
+
----------------
yronglin wrote:

Thanks for the review! 

> Maybe drop the embedded directive changes from this PR so we can land it and 
> then do those in a separate PR?

Sure, I just revert the embeded directive changes.

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

Reply via email to