Fix for PR5707: make sure implicit copy constructors initialize the vtable
pointer.

llvm-svn: 90840
diff --git a/clang/lib/CodeGen/CGCXX.cpp b/clang/lib/CodeGen/CGCXX.cpp
index 0b77584..bd166d0 100644
--- a/clang/lib/CodeGen/CGCXX.cpp
+++ b/clang/lib/CodeGen/CGCXX.cpp
@@ -1572,6 +1572,8 @@
       EmitAggregateCopy(LHS.getAddress(), RHS.getAddress(), Field->getType());
     }
   }
+
+  InitializeVtablePtrs(ClassDecl);
   FinishFunction();
 }
 
@@ -1812,6 +1814,10 @@
       PopCXXTemporary();
   }
 
+  InitializeVtablePtr(ClassDecl);
+}
+
+void CodeGenFunction::InitializeVtablePtrs(const CXXRecordDecl *ClassDecl) {
   if (!ClassDecl->isDynamicClass())
     return;