llvmbot wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Younan Zhang (zyn0217)

<details>
<summary>Changes</summary>

Spotted by Shafik in 
https://github.com/llvm/llvm-project/pull/161671#discussion_r2453641287

---
Full diff: https://github.com/llvm/llvm-project/pull/164781.diff


1 Files Affected:

- (modified) clang/lib/Sema/SemaConcept.cpp (+2-1) 


``````````diff
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;

``````````

</details>


https://github.com/llvm/llvm-project/pull/164781
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to