File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -7089,8 +7089,8 @@ void CodeGenModule::EmitTopLevelDecl(Decl *D) {
70897089 // For C++ standard modules we are done - we will call the module
70907090 // initializer for imported modules, and that will likewise call those for
70917091 // any imports it has.
7092- if (CXX20ModuleInits && Import->getImportedOwningModule () &&
7093- ! Import->getImportedOwningModule ()->isModuleMapModule ())
7092+ if (CXX20ModuleInits && Import->getImportedModule () &&
7093+ Import->getImportedModule ()->isNamedModule ())
70947094 break ;
70957095
70967096 // For clang C++ module map modules the initializers for sub-modules are
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 -triple %itanium_abi_triple -std=c++20 %t/a.cppm -emit-module-interface -o %t/a.pcm
6+ // RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++20 %t/a.cpp -fmodule-file=a=%t/a.pcm -emit-llvm -o - | FileCheck %t/a.cpp
7+
8+ // --- a.cppm
9+ export module a;
10+ int func ();
11+ static int a = func();
12+
13+ // --- a.cpp
14+ import a;
15+
16+ // CHECK-NOT: internal global
17+ // CHECK-NOT: __cxx_global_var_init
18+
You can’t perform that action at this time.
0 commit comments