This suppresses some -Wsign-conversion warnings from Clang when
compiling with -Wsystem-headers.
libstdc++-v3/ChangeLog:
* include/std/bit (__rotl, __rotr): Use static_cast for
conversion from int to unsigned.
Reviewed-by: Tomasz KamiĆski <tkaminsk@redhat.com>
// Variant for power of two _Nd which the compiler can
// easily pattern match.
constexpr unsigned __uNd = _Nd;
- const unsigned __r = __s;
+ const auto __r = static_cast<unsigned>(__s);
return (__x << (__r % __uNd)) | (__x >> ((-__r) % __uNd));
}
const int __r = __s % _Nd;
// Variant for power of two _Nd which the compiler can
// easily pattern match.
constexpr unsigned __uNd = _Nd;
- const unsigned __r = __s;
+ const auto __r = static_cast<unsigned>(__s);
return (__x >> (__r % __uNd)) | (__x << ((-__r) % __uNd));
}
const int __r = __s % _Nd;