Skip to content

Commit dbdd637

Browse files
committed
Revert "[ABI] [C++20] [Modules] Don't generate vtable if the class is defined in other module unit"
Breaks check-clang on win and mac, see comments on https://reviews.llvm.org/D150023 This reverts commit d8a36b0. Also revert follow-up "[NFC] skip the test modules-vtable.cppm on windows" This reverts commit baf0b12.
1 parent 4cfc33b commit dbdd637

File tree

2 files changed

+1
-106
lines changed

2 files changed

+1
-106
lines changed

clang/lib/CodeGen/CGVTables.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,16 +1172,9 @@ bool CodeGenVTables::isVTableExternal(const CXXRecordDecl *RD) {
11721172
if (!keyFunction)
11731173
return false;
11741174

1175-
const FunctionDecl *Def;
11761175
// Otherwise, if we don't have a definition of the key function, the
11771176
// vtable must be defined somewhere else.
1178-
if (!keyFunction->hasBody(Def))
1179-
return true;
1180-
1181-
assert(Def && "The body of the key function is not assigned to Def?");
1182-
// If the non-inline key function comes from another module unit, the vtable
1183-
// must be defined there.
1184-
return Def->isInAnotherModuleUnit() && !Def->isInlineSpecified();
1177+
return !keyFunction->hasBody();
11851178
}
11861179

11871180
/// Given that we're currently at the end of the translation unit, and

clang/test/CodeGenCXX/modules-vtable.cppm

Lines changed: 0 additions & 98 deletions
This file was deleted.

0 commit comments

Comments
 (0)