File tree 2 files changed +36
-0
lines changed
2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -7198,6 +7198,8 @@ void ASTRecordWriter::AddCXXDefinitionData(const CXXRecordDecl *D) {
7198
7198
7199
7199
bool ModulesCodegen =
7200
7200
!D->isDependentType () &&
7201
+ D->getTemplateSpecializationKind () !=
7202
+ TSK_ExplicitInstantiationDeclaration &&
7201
7203
(Writer->getLangOpts ().ModulesDebugInfo || D->isInNamedModule ());
7202
7204
Record->push_back (ModulesCodegen);
7203
7205
if (ModulesCodegen)
Original file line number Diff line number Diff line change
1
+ // RUN: rm -rf %t
2
+ // RUN: mkdir %t
3
+ // RUN: split-file %s %t
4
+
5
+ // RUN: %clang_cc1 -std=c++20 %t/a.cppm -triple %itanium_abi_triple -emit-module-interface -o %t/a.pcm
6
+ // RUN: %clang_cc1 -std=c++20 %t/a.cc -triple %itanium_abi_triple -fmodule-file=a=%t/a.pcm -emit-llvm -o - | FileCheck %t/a.cc
7
+ //
8
+ // RUN: %clang_cc1 -std=c++20 %t/a.cppm -triple %itanium_abi_triple -emit-reduced-module-interface -o %t/a.pcm
9
+ // RUN: %clang_cc1 -std=c++20 %t/a.cc -triple %itanium_abi_triple -fmodule-file=a=%t/a.pcm -emit-llvm -o - | FileCheck %t/a.cc
10
+
11
+ // --- a.cppm
12
+ export module a;
13
+ class base {
14
+ public:
15
+ ~base () = default ;
16
+ virtual void foo ();
17
+ };
18
+
19
+ template <class T >
20
+ class a : public base {
21
+ public:
22
+ virtual void foo () override ;
23
+ };
24
+
25
+ extern template class a <int >;
26
+
27
+ // --- a.cc
28
+ module a;
29
+
30
+ template <class T >
31
+ void a<T>::foo() {}
32
+
33
+ template class a <int >;
34
+ // CHECK: _ZTVW1a1aIiE
You can’t perform that action at this time.
0 commit comments