aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDeclCXX.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sema/SemaDeclCXX.cpp')
-rw-r--r--lib/Sema/SemaDeclCXX.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp
index 0565a7fef9..b4c375d638 100644
--- a/lib/Sema/SemaDeclCXX.cpp
+++ b/lib/Sema/SemaDeclCXX.cpp
@@ -7118,6 +7118,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;