Revert 124768.
This reopens PR99114, but that one at least can be avoided with an #include.
PR9130 cannot.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124780 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp
index 0565a7f..b4c375d 100644
--- a/lib/Sema/SemaDeclCXX.cpp
+++ b/lib/Sema/SemaDeclCXX.cpp
@@ -7118,6 +7118,13 @@
       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;