================
@@ -893,6 +902,16 @@ class TokenCollector::Builder {
TokenBuffer TokenCollector::consume() && {
PP.setTokenWatcher(nullptr);
Collector->disable();
+
+ /// If the parser hit an module load fatal error, the TokenCollector will not
+ /// receive an EOF token; we need to add an EOF token to the end of the token
+ /// sequence.
+ if (PP.hadModuleLoaderFatalFailure() &&
----------------
ChuanqiXu9 wrote:
I don't think we should change the logics in `ModulesBuilder`. It is by design
that FailedPrerequisiteModules doesn't change header search options. In another
point of view, we made the change in Lexer and clangd crashes, so the root
cause is in Lexer and not clangd.
And I think, for parsing C++20 named modules, we don't need to care about
`PP.hadModuleLoaderFatalFailure()`. It shouldn't matter/count for lexing C++20
named modules.
https://github.com/llvm/llvm-project/pull/187858
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits