I stumbled upon this yesterday. Without this patch in palce, the module map load is silently ignored, and this might cause subtle breakages.
Details
Diff Detail
Event Timeline
Hmm, I think you're right. It's not actually that silent (it fails with a fatal error when trying to load/read).
That said, I think it might still be valuable to emit a diagnostic -- Richard what do you think?
I noticed you reported a very similar problem here: https://llvm.org/bugs/show_bug.cgi?id=20468
Also, I looked at the code more closely and I think the right place to diagnose this would be lib/Frontend/FrontendAction.cpp, in BeginSourceFile, around line 390, and not where I'm diagnosing it right now. Thoughts?
I would prefer that we solve this problem generically for all files that Clang tries to open, not just for module map files. (Note, for instance, that PR20468 concerns files referenced by module map files, such as their nominated headers, not the module map files themselves.)
lib/Frontend/FrontendActions.cpp | ||
---|---|---|
269 | Why don't we fail up here when trying to open the file for read? |
Why don't we fail up here when trying to open the file for read?