File tree Expand file tree Collapse file tree 2 files changed +60
-0
lines changed Expand file tree Collapse file tree 2 files changed +60
-0
lines changed Original file line number Diff line number Diff line change @@ -1133,6 +1133,8 @@ bool Decl::isInExportDeclContext() const {
11331133}
11341134
11351135bool Decl::isModuleLocal () const {
1136+ if (isa<NamespaceDecl, TranslationUnitDecl>(this ))
1137+ return false ;
11361138 auto *M = getOwningModule ();
11371139 return M && M->isNamedModule () &&
11381140 getModuleOwnershipKind () == ModuleOwnershipKind::ReachableWhenImported;
Original file line number Diff line number Diff line change 1+ // RUN: rm -rf %t
2+ // RUN: mkdir -p %t
3+ // RUN: split-file %s %t
4+
5+ // RUN: %clang_cc1 -std=c++20 %t/b.cppm -emit-module-interface -o %t/b.pcm
6+ // RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-module-interface -o %t/a.pcm \
7+ // RUN: -fmodule-file=a:b=%t/b.pcm
8+ // RUN: %clang_cc1 -std=c++20 %t/c.cppm -emit-module-interface -o %t/c.pcm \
9+ // RUN: -fmodule-file=a:b=%t/b.pcm -fmodule-file=a=%t/a.pcm
10+
11+ // RUN: %clang_cc1 -std=c++20 %t/b.cppm -emit-reduced-module-interface -o %t/b.pcm
12+ // RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-reduced-module-interface -o %t/a.pcm \
13+ // RUN: -fmodule-file=a:b=%t/b.pcm
14+ // RUN: %clang_cc1 -std=c++20 %t/c.cppm -emit-reduced-module-interface -o %t/c.pcm \
15+ // RUN: -fmodule-file=a:b=%t/b.pcm -fmodule-file=a=%t/a.pcm
16+
17+
18+ // --- b.cppm
19+ export module a:b;
20+ class Polymorphic {
21+ public:
22+ virtual ~Polymorphic () = default ;
23+ };
24+
25+ // --- a.h
26+ namespace std {
27+ using X = int ;
28+ }
29+
30+ namespace a {
31+ using std::X;
32+ }
33+
34+ // --- a.cppm
35+ module ;
36+ #include " a.h"
37+ export module a;
38+ import :b;
39+ std::X var;
40+ namespace std {
41+ export using std::X;
42+ }
43+ namespace a {
44+ export using std::X;
45+ }
46+
47+ // --- c.cppm
48+ export module c;
49+ import a;
50+ namespace a {
51+ export using std::X;
52+ }
53+
54+ namespace a {
55+ X test () {
56+ return X{};
57+ }
58+ }
You can’t perform that action at this time.
0 commit comments