-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[C++20] [Modules] Make sure vtable are generated for explicit templat…
…e instantiation definition (#123871) Close llvm/llvm-project#123719 The reason is, we thought the external explicit template instantiation declaration as the external definition incorrectly.
- Loading branch information
1 parent
582fe3e
commit 05861b3
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// RUN: rm -rf %t | ||
// RUN: mkdir %t | ||
// RUN: split-file %s %t | ||
|
||
// RUN: %clang_cc1 -std=c++20 %t/a.cppm -triple %itanium_abi_triple -emit-module-interface -o %t/a.pcm | ||
// 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 | ||
// | ||
// RUN: %clang_cc1 -std=c++20 %t/a.cppm -triple %itanium_abi_triple -emit-reduced-module-interface -o %t/a.pcm | ||
// 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 | ||
|
||
//--- a.cppm | ||
export module a; | ||
class base { | ||
public: | ||
~base() = default; | ||
virtual void foo(); | ||
}; | ||
|
||
template <class T> | ||
class a : public base { | ||
public: | ||
virtual void foo() override; | ||
}; | ||
|
||
extern template class a<int>; | ||
|
||
//--- a.cc | ||
module a; | ||
|
||
template <class T> | ||
void a<T>::foo() {} | ||
|
||
template class a<int>; | ||
// CHECK: _ZTVW1a1aIiE |