StoreAnyExprIntoOneUnit(*this, E, curPtr);
// Leave the cleanup if we entered one.
- if (cleanup != EHStack.stable_end()) {
+ if (cleanupDominator) {
DeactivateCleanupBlock(cleanup, cleanupDominator);
cleanupDominator->eraseFromParent();
}
RequiresZeroInitialization);
return;
} else if (E->getNumConstructorArgs() == 1 &&
- isa<ImplicitValueInitExpr>(E->getConstructorArg(0))) {
+ isa<ImplicitValueInitExpr>(E->getConstructorArg(0)) &&
+ CGF.CGM.getTypes().isZeroInitializable(ElementType)) {
// Optimization: since zero initialization will just set the memory
// to all zeroes, generate a single memset to do it in one shot.
EmitZeroMemSet(CGF, ElementType, NewPtr, AllocSizeWithoutCookie);
template void f<int>();
}
+
+namespace PR11523 {
+ class MyClass;
+ typedef int MyClass::* NewTy;
+ // CHECK: define i64* @_ZN7PR115231fEv
+ // CHECK: store i64 -1
+ NewTy* f() { return new NewTy[2](); }
+}