diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp --- a/clang/lib/Sema/SemaExprCXX.cpp +++ b/clang/lib/Sema/SemaExprCXX.cpp @@ -2657,11 +2657,10 @@ // FIXME: Should the Sema create the expression and embed it in the syntax // tree? Or should the consumer just recalculate the value? // FIXME: Using a dummy value will interact poorly with attribute enable_if. - IntegerLiteral Size( - Context, - llvm::APInt::getZero( - Context.getTargetInfo().getPointerWidth(LangAS::Default)), - Context.getSizeType(), SourceLocation()); + QualType SizeTy = Context.getSizeType(); + unsigned SizeTyWidth = Context.getTypeSize(SizeTy); + IntegerLiteral Size(Context, llvm::APInt::getZero(SizeTyWidth), SizeTy, + SourceLocation()); AllocArgs.push_back(&Size); QualType AlignValT = Context.VoidTy;