summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaDeclCXX.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index 5da10352cc1..c9c58b3e3a4 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -7110,6 +7110,13 @@ bool Sema::DefineUsedVTables() {
switch (KeyFunction->getTemplateSpecializationKind()) {
case TSK_Undeclared:
case TSK_ExplicitSpecialization:
+ // The key function is in another translation unit. Mark all of the
+ // virtual members of this class as referenced so that we can build a
+ // vtable anyway (in order to do devirtualization when optimizations
+ // are turned on for example.
+ MarkVirtualMembersReferenced(Loc, Class);
+ continue;
+
case TSK_ExplicitInstantiationDeclaration:
// The key function is in another translation unit.
continue;
OpenPOWER on IntegriCloud