-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[libc++][math] Add constexpr
for std::signbit()
#105946
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
Merged
Merged
+98
−6
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8557bf4
to
17bd05b
Compare
✅ With the latest revision this PR passed the C/C++ code formatter. |
a22802a
to
5ceea95
Compare
12d1510
to
0fddfac
Compare
@philnik777, could you have another look? |
ldionne
reviewed
Aug 30, 2024
philnik777
reviewed
Aug 30, 2024
5e66d55
to
23085d3
Compare
d843b87
to
f01f15c
Compare
philnik777
reviewed
Sep 4, 2024
We will add the overloads in a seperate patch.
Custom notes are encoded via GitHub issues from now on.
f01f15c
to
b02f003
Compare
philnik777
approved these changes
Sep 5, 2024
philnik777
pushed a commit
that referenced
this pull request
Sep 12, 2024
…pes for `std::signbit` (#106566) ## Why Following up on #105946, this patch provides the floating point overloads for `std::signbit` as defined by [P0533R9](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf). ## What * Test and add overloads for cv-unqualified floating point types * Remove constrained overload as it is not needed anymore * Make use of `template<class = void>` as the universal C runtime (UCRT) needed for Clang-Cl comes with overloads for all cv-unqualified floating point types (float, double, long double) for `std::signbit()` by itself [in the WinSDK](https://github.com/microsoft/win32metadata/blob/e012b29924c53aa941fc010850b68331b0c3ea80/generation/WinSDK/RecompiledIdlHeaders/ucrt/corecrt_math.h#L309-L322). In a certain way, this can be seen as a deviation from the C standard. We need to work around it as the compilation would otherwise error out due to duplicated definitions.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why
Since 18th of August, the floating point comparison builtin
__builtin_signbit
is available in Clang as constant expression (#94118).What
constexpr
forstd::signbit()
as defined by P0533R9 (new C++23 feature)