diff --git a/clang/lib/CodeGen/CGExprCXX.cpp b/clang/lib/CodeGen/CGExprCXX.cpp index 9596ed34e5e9..54c87a7361b1 100644 --- a/clang/lib/CodeGen/CGExprCXX.cpp +++ b/clang/lib/CodeGen/CGExprCXX.cpp @@ -2101,10 +2101,9 @@ void CodeGenFunction::EmitCXXDeleteExpr(const CXXDeleteExpr *E) { GEP.push_back(Zero); } - Ptr = Address::deprecated(Builder.CreateInBoundsGEP(Ptr.getElementType(), - Ptr.getPointer(), GEP, - "del.first"), - Ptr.getAlignment()); + Ptr = Address(Builder.CreateInBoundsGEP(Ptr.getElementType(), + Ptr.getPointer(), GEP, "del.first"), + ConvertTypeForMem(DeleteTy), Ptr.getAlignment()); } assert(ConvertTypeForMem(DeleteTy) == Ptr.getElementType());