================
@@ -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 ||
----------------
AaronBallman wrote:
```suggestion
bool IsError = LangOpts.CPlusPlus26 ||
```
https://github.com/llvm/llvm-project/pull/192073
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits