diff --git a/clang/lib/Sema/SemaConcept.cpp b/clang/lib/Sema/SemaConcept.cpp index f77fca2a69e00..70149464b3a99 100644 --- a/clang/lib/Sema/SemaConcept.cpp +++ b/clang/lib/Sema/SemaConcept.cpp @@ -2669,8 +2669,9 @@ FormulaType SubsumptionChecker::Normalize(const NormalizedConstraint &NC) { }); if (Compound.getCompoundKind() == FormulaType::Kind) { + unsigned SizeLeft = Left.size(); Res = std::move(Left); - Res.reserve(Left.size() + Right.size()); + Res.reserve(SizeLeft + Right.size()); std::for_each(std::make_move_iterator(Right.begin()), std::make_move_iterator(Right.end()), Add); return Res;