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

Andrei Golubev via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 15 03:00:00 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);
----------------
andrey-golubev wrote:

added. please also take a look on the new function (i'm not a native English speaker so maybe there are errors in the docs. albeit I pretty much copy-pasted the relevant `set_size` wording).

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


More information about the llvm-commits mailing list