================
@@ -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:

Oh, sorry, I didn't make my question clear in the first place. 

My question is, for `PP.hadModuleLoaderFatalFailure()`, my instinct action is, 
since we shouldn't load module for C++20 named modules **in preprocessor**, 
`PP.hadModuleLoaderFatalFailure()` should always return false. 

Does this sound right?

In another word, in my mind, if we're going to try to import a C++20 named 
module in preprocessor, it is wrong.

But I guess it may not be the case otherwise we should see more bug reports so 
I feel it may be an odd code path for clangd only.




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