Closed
Description
The following program built with -std=c++23 -stdlib=libc++ -fsanitize=implicit-integer-sign-change
causes:
include/c++/v1/__bit/rotate.h:27:8: runtime error: implicit conversion from type 'int' of value -1 (32-bit, signed) to type 'unsigned int' changed the value to 4294967295 (32-bit, unsigned)
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /opt/compiler-explorer/clang-18.1.0/bin/../include/c++/v1/__bit/rotate.h:27:8
#include <bit>
int main()
{
return std::rotr(0u, -1);
}
https://godbolt.org/z/EveTsa8Gs
If you think this is worth fixing I can submit a patch.