Commit b50a2cc
committed
[libc][bit_test] fix -Wimplicit-int-conversion
Fixes:
llvm-project/libc/src/__support/CPP/bit.h:235:28: error: implicit
conversion loses integer precision: 'int' to
'cpp::enable_if_t<cpp::is_unsigned_v<unsigned short>, unsigned short>' (aka
'unsigned short') [-Werror,-Wimplicit-int-conversion]
235 | return (value << rotate) | (value >> (N - rotate));
| ~~~~~~ ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
llvm-project/libc/src/__support/CPP/bit.h:247:28: error: implicit
conversion loses integer precision: 'int' to
'cpp::enable_if_t<cpp::is_unsigned_v<unsigned short>, unsigned short>' (aka
'unsigned short') [-Werror,-Wimplicit-int-conversion]
247 | return (value >> rotate) | (value << (N - rotate));
| ~~~~~~ ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
llvm-project/libc/test/src/__support/CPP/bit_test.cpp:45:36: error:
implicit conversion loses integer precision: 'int' to 'unsigned char'
[-Werror,-Wimplicit-int-conversion]
45 | EXPECT_FALSE(has_single_bit<T>(two_bits_value));
| ~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~
Via the libc-cpp-utils-tests ninja target.1 parent 72aa388 commit b50a2cc
File tree
2 files changed
+4
-3
lines changed- libc
- src/__support/CPP
- test/src/__support/CPP
2 files changed
+4
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
235 | | - | |
| 235 | + | |
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
| |||
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
247 | | - | |
| 247 | + | |
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
0 commit comments