diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp index eea0827d6f7a8..320e2ef12c38d 100644 --- a/clang/lib/AST/ExprConstant.cpp +++ b/clang/lib/AST/ExprConstant.cpp @@ -6867,8 +6867,8 @@ static std::optional CheckDeleteKind(EvalInfo &Info, const Expr *E, return std::nullopt; } - QualType AllocType = Pointer.Base.getDynamicAllocType(); if (DeallocKind != (*Alloc)->getKind()) { + QualType AllocType = Pointer.Base.getDynamicAllocType(); Info.FFDiag(E, diag::note_constexpr_new_delete_mismatch) << DeallocKind << (*Alloc)->getKind() << AllocType; NoteLValueLocation(Info, Pointer.Base);