"llvm/lib/Object/RecordStreamer.h" did not exist on "13b69d63e6a941e4d01ffff5a2486ec2c3898c42"
[C++20] [Modules] Judge current module correctly
Now the implementation would accept following code: ``` //--- impl.cppm module M:impl; class A {}; //--- M.cppm export module M; import :impl; //--- Use.cpp import M; void test() { A a; // Expected error. A is not visible here. } ``` which is clearly wrong. The root cause is the implementation of `isInCurrentModule` would return true if the module is a partition! So in the above example, although Use.cpp is not a module unit, `isInCurrentModule ` would still return true when the compiler tries to see if the owning module of `A` is the current module. I believe this is an oversight. This patch tries to fix this problem. Reviewed By: iains Differential Revision: https://reviews.llvm.org/D123837
Loading
Please sign in to comment