[C++20] [Module] Support reachable definition initially/partiallyThis patch introduces a new kind of ModuleOwnershipKind asReachableWhenImported. This intended the status for reachable describeda
[C++20] [Module] Support reachable definition initially/partiallyThis patch introduces a new kind of ModuleOwnershipKind asReachableWhenImported. This intended the status for reachable describedat: https://eel.is/c++draft/module.reach#3.Note that this patch is not intended to support all semantics aboutreachable semantics. For example, this patch didn't implement discardeddeclarations in GMF. (https://eel.is/c++draft/module.global.frag#3).This fixes: https://bugs.llvm.org/show_bug.cgi?id=52281 andhttps://godbolt.org/z/81f3ocjfW.Reviewed By: rsmith, iainsDifferential Revision: https://reviews.llvm.org/D113545
show more ...
Revert "[C++20] [Modules] Implement Reachable initiallly"This reverts commit a223ba0a697c1598b434cf2495c9cd9ec5640fc7.The previous commit don't contain additional information, which is bad.
[C++20] [Modules] Implement Reachable initiallly
[C++20] [Modules] Judge current module correctlyNow the implementation would accept following code:```//--- impl.cppmmodule M:impl;class A {};//--- M.cppmexport module M;import :impl;//--
[C++20] [Modules] Judge current module correctlyNow the implementation would accept following code:```//--- impl.cppmmodule M:impl;class A {};//--- M.cppmexport module M;import :impl;//--- Use.cppimport 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! Soin the above example, although Use.cpp is not a module unit,`isInCurrentModule ` would still return true when the compiler tries tosee if the owning module of `A` is the current module. I believe this isan oversight. This patch tries to fix this problem.Reviewed By: iainsDifferential Revision: https://reviews.llvm.org/D123837