Skip to content

Commit ffddca8

Browse files
OrestChuraShaojieZhuIntel
authored andcommitted
Fix compilation warnings
1 parent 2cb3884 commit ffddca8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/include/llvm/ADT/SmallVector.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,9 @@ template <class Size_T> class SmallVectorBase {
100100
///
101101
/// This does not construct or destroy any elements in the vector.
102102
void set_size(size_t N) {
103-
assert(N <= capacity()); // implies no overflow in assignment
104-
Size = static_cast<Size_T>(N);
103+
auto n = static_cast<Size_T>(N);
104+
assert(n <= capacity());
105+
Size = n;
105106
}
106107

107108
/// Set the array data pointer to \p Begin and capacity to \p N.

0 commit comments

Comments
 (0)