Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Poison "quantized int" specializations of std::is_signed, as a first step towards removing them. #21847

Merged
merged 1 commit into from
Jan 28, 2025

Conversation

copybara-service[bot]
Copy link

Poison "quantized int" specializations of std::is_signed, as a first step towards removing them.

This specialization is not permitted per the C++ standard, and thus:

  • MSVC silently ignores specializations of std::is_signed, since VS2019 16.4.
  • Clang emits error: 'is_signed' cannot be specialized: Users are not allowed to specialize this standard library entity [-Winvalid-specialization] by default, as of Clang 20.

Also, modify all relevant callers of std::is_signed<T> for which the change triggered a compilation failure to instead call std::numeric_limits<T>::is_signed.

Note that std::numeric_limits is permitted to be specialized for user types.

@copybara-service copybara-service bot force-pushed the test_719339288 branch 3 times, most recently from 3efae36 to d9c6862 Compare January 28, 2025 16:39
…step towards removing them.

This specialization is not permitted per the C++ standard, and thus:
- MSVC silently ignores specializations of `std::is_signed`, since VS2019 16.4.
- Clang emits `error: 'is_signed' cannot be specialized: Users are not allowed to specialize this standard library entity [-Winvalid-specialization]` by default, as of Clang 20.

Also, modify all relevant callers of `std::is_signed<T>` for which the change triggered a compilation failure to instead call `std::numeric_limits<T>::is_signed`.

Note that `std::numeric_limits` _is_ permitted to be specialized for user types.

PiperOrigin-RevId: 720602373
@copybara-service copybara-service bot merged commit bb8a7f3 into main Jan 28, 2025
@copybara-service copybara-service bot deleted the test_719339288 branch January 28, 2025 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant