================
@@ -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() &&
----------------
yronglin wrote:

IIUC, the load failure came from `import NonExistent;`.

> If we won't load modules at all, why would we have a load failure?

Clangd will tigger parser/sema analysis and the we will try to load module in 
ParseModuleImport.

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

Reply via email to