We have been incorrectly disallowing imports of named modules in the
global and private module fragments.
This addresses: https://github.com/llvm/llvm-project/issues/59688
Paths
| Differential D140927
[C++20][Modules] Fix named module import diagnostics. ClosedPublic Authored by iains on Jan 3 2023, 2:57 PM.
Details Summary We have been incorrectly disallowing imports of named modules in the This addresses: https://github.com/llvm/llvm-project/issues/59688
Diff Detail
Event TimelineComment Actions [module.import]p1 says:
So the following case is invalid: //--- b.hpp void func() {} import a; //--- c.cpp module; #include "b.hpp" export module c; I feel we'd better to address such cases in the test. Comment Actions
I am not sure about this - what you are suggesting above would seem to make modules useless when there is a GMF (since there is almost no point to having a GMF that has no decls). https://eel.is/c++draft/basic.link#1 Make the declaration-seq of a module unit specifically follow the module keyword. https://eel.is/c++draft/module#import-1 (which you quoted from above) adds to this the PMF - but I do not see that it includes the GMF (since that is neither the declaration-seq of the module unit nor is it the PMF. (this + 15.5 named Header Unit import is why the original bug is there .. ) Comment Actions From the discussion in https://github.com/llvm/llvm-project/issues/59688, I feel you are correct. But let's wait for we get a clarification. This revision is now accepted and ready to land.Jan 5 2023, 6:08 PM This revision was landed with ongoing or failed builds.Jan 22 2023, 2:23 AM Closed by commit rG53a1314ed1b5: [C++20][Modules] Fix named module import diagnostics. (authored by iains). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 491139 clang/include/clang/Sema/Sema.h
clang/lib/Parse/Parser.cpp
clang/lib/Sema/SemaModule.cpp
clang/test/Modules/cxx20-import-diagnostics-a.cpp
clang/test/Modules/cxx20-import-diagnostics-b.cpp
|