[llvm] [LLVM][ADT] Explicitly convert size_t values to SmallVector's size type (PR #77939)

Andrew Browne via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 17 09:49:12 PST 2024


================
@@ -468,7 +469,7 @@ void SmallVectorTemplateBase<T, TriviallyCopyable>::takeAllocationForGrow(
     free(this->begin());
 
   this->BeginX = NewElts;
-  this->Capacity = NewCapacity;
+  this->Capacity = static_cast<SmallVectorSizeType<T>>(NewCapacity);
----------------
browneee wrote:

I prefer `set_allocation_and_capacity`, but I think any of these options are fine.

https://github.com/llvm/llvm-project/pull/77939


More information about the llvm-commits mailing list