[libcxx-commits] [libcxx] [libc++] Reject cv-qualified types in __is_signed/unsigned_integer_v (PR #200377)
Nikolas Klauser via libcxx-commits
libcxx-commits at lists.llvm.org
Fri May 29 07:15:17 PDT 2026
================
@@ -47,5 +47,12 @@ int main(int, char**)
static_assert(toobig<std::uintmax_t>(), ""); // expected-error {{static assertion expression is not an integral constant expression}}
static_assert(toobig<std::uintptr_t>(), ""); // expected-error {{static assertion expression is not an integral constant expression}}
+ // cv-qualified versions are not unsigned integer types per
+ // [basic.fundamental]/p2. Explicit template args bypass by-value
+ // deduction strip, so the constraint must reject these.
+ std::bit_ceil<const unsigned int>(0u); // expected-error {{no matching function for call to 'bit_ceil'}}
+ std::bit_ceil<volatile unsigned int>(0u); // expected-error {{no matching function for call to 'bit_ceil'}}
+ std::bit_ceil<const volatile unsigned long>(0ul); // expected-error {{no matching function for call to 'bit_ceil'}}
----------------
philnik777 wrote:
Assuming we even want to test this, this should be a SFINAE test.
https://github.com/llvm/llvm-project/pull/200377
More information about the libcxx-commits
mailing list