Abstract more member-pointerness out.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111771 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp
index 5bee016..ca4e698 100644
--- a/lib/CodeGen/CodeGenFunction.cpp
+++ b/lib/CodeGen/CodeGenFunction.cpp
@@ -579,7 +579,8 @@
// If the type contains a pointer to data member we can't memset it to zero.
// Instead, create a null constant and copy it to the destination.
- if (CGM.getTypes().ContainsPointerToDataMember(Ty)) {
+ if (CGM.getLangOptions().CPlusPlus &&
+ CGM.getCXXABI().RequiresNonZeroInitializer(Ty)) {
llvm::Constant *NullConstant = CGM.EmitNullConstant(Ty);
llvm::GlobalVariable *NullVariable =