[clang] [Clang] Reject and recover from malformed module directive (PR #245099)
Chen Miao via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 23 20:49:09 PST 2026
================
@@ -4362,11 +4362,24 @@ void Preprocessor::HandleCXXModuleDirective(Token ModuleTok) {
DirToks.push_back(Tok);
LexUnexpandedToken(Tok);
if (Tok.isNot(tok::kw_private)) {
- if (Tok.isNot(tok::eod))
- CheckEndOfDirective(ModuleTok.getIdentifierInfo()->getName(),
- /*EnableMacros=*/false, &DirToks);
- EnterModuleSuffixTokenStream(DirToks);
- return;
+ // Remember wrong token location.
----------------
ChenMiaoi wrote:
Do we need this many comments?
https://github.com/llvm/llvm-project/pull/245099
More information about the cfe-commits
mailing list