diff options
author | Chuanqi Xu <yedeng.yd@linux.alibaba.com> | 2022-06-29 12:43:26 +0800 |
---|---|---|
committer | Chuanqi Xu <yedeng.yd@linux.alibaba.com> | 2022-06-29 12:43:26 +0800 |
commit | 7a541406b5a23a811a4f37432292a6de3307b0f1 (patch) | |
tree | 4d3abeac5a9330613f07aff87608b57774637371 /clang/lib/Sema/SemaModule.cpp | |
parent | a223ba0a697c1598b434cf2495c9cd9ec5640fc7 (diff) | |
download | llvm-7a541406b5a23a811a4f37432292a6de3307b0f1.zip llvm-7a541406b5a23a811a4f37432292a6de3307b0f1.tar.gz llvm-7a541406b5a23a811a4f37432292a6de3307b0f1.tar.bz2 |
Revert "[C++20] [Modules] Implement Reachable initiallly"
This reverts commit a223ba0a697c1598b434cf2495c9cd9ec5640fc7.
The previous commit don't contain additional information, which is bad.
Diffstat (limited to 'clang/lib/Sema/SemaModule.cpp')
-rw-r--r-- | clang/lib/Sema/SemaModule.cpp | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/clang/lib/Sema/SemaModule.cpp b/clang/lib/Sema/SemaModule.cpp index 3aa124d..b0e7d30 100644 --- a/clang/lib/Sema/SemaModule.cpp +++ b/clang/lib/Sema/SemaModule.cpp @@ -90,14 +90,7 @@ Sema::ActOnGlobalModuleFragmentDecl(SourceLocation ModuleLoc) { // All declarations created from now on are owned by the global module. auto *TU = Context.getTranslationUnitDecl(); - // [module.global.frag]p2 - // A global-module-fragment specifies the contents of the global module - // fragment for a module unit. The global module fragment can be used to - // provide declarations that are attached to the global module and usable - // within the module unit. - // - // So the declations in the global module shouldn't be visible by default. - TU->setModuleOwnershipKind(Decl::ModuleOwnershipKind::ReachableWhenImported); + TU->setModuleOwnershipKind(Decl::ModuleOwnershipKind::Visible); TU->setLocalOwningModule(GlobalModule); // FIXME: Consider creating an explicit representation of this declaration. @@ -332,12 +325,10 @@ Sema::ActOnModuleDecl(SourceLocation StartLoc, SourceLocation ModuleLoc, VisibleModules.setVisible(Mod, ModuleLoc); // From now on, we have an owning module for all declarations we see. - // In C++20 modules, those declaration would be reachable when imported - // unless explicitily exported. - // Otherwise, those declarations are module-private unless explicitly + // However, those declarations are module-private unless explicitly // exported. auto *TU = Context.getTranslationUnitDecl(); - TU->setModuleOwnershipKind(Decl::ModuleOwnershipKind::ReachableWhenImported); + TU->setModuleOwnershipKind(Decl::ModuleOwnershipKind::ModulePrivate); TU->setLocalOwningModule(Mod); // We are in the module purview, but before any other (non import) |