Clang's "unsigned integer overflow" sanitizer can't tell the difference between expected unsigned wraparound and a bug, and its developers tell users to report bugs against libstdc++. This disables the sanitizer where we are intentionally relying on wraparound working as defined by the standard. libstdc++-v3/ChangeLog: PR libstdc++/91547 PR libstdc++/97844 * include/bits/c++config (_GLIBCXX_NO_UNSIGNED_OVERFLOW): Define new macro for Clang's no_sanitize("unsigned-integer-overflow") attribute. * include/bits/basic_string.h (basic_string::_S_compare): Add _GLIBCXX_NO_UNSIGNED_OVERFLOW. * include/bits/basic_string.tcc (basic_string::find_last_of) (basic_string::find_last_not_of): Likewise. * include/bits/string_view.tcc (basic_string_view::find_last_not_of): Likewise. * include/std/string_view (basic_string_view::_S_compare): Likewise. Should we make this change? It won't stop bogus bug reports unless we also do it on the branches, or wait until nobody is using older libstdc++ headers with recent Clang releases. But it might help eventually.