[libcxx-commits] [libcxx] [libc++] Fix broken precondition of __bit_log2 (PR #155476)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Tue Aug 26 23:49:19 PDT 2025


https://github.com/philnik777 requested changes to this pull request.

I'm not a huge fan of this as-is. I've seen multiple people comment about us breaking UBsan for unsigned integers, but nobody seems to care to actually do the legwork and just enable it for all our tests. I'm not against adding an assertion in `__bit_log2`, but I don't think "people don't want unsigned overflow" is a good reason to do so. Someone should just do the actual work to allow using UBSan with unsigned overflow checking in libc++, since we will run into this again and again otherwise.


https://github.com/llvm/llvm-project/pull/155476


More information about the libcxx-commits mailing list