-
Notifications
You must be signed in to change notification settings - Fork 12.4k
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
[libc++] Add std::fpclassify overloads for floating-point. #67913
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation looks good, but this needs tests. Specifically,
- there should be a regression test to make sure an implicit conversion works now
- please make sure that we have test coverage for the
_LIBCPP_NODISCARD_EXT
s - please make sure that we have test for the
noexcept
ness of the overloads.
You should be able to find tests for this under libcxx/test/libcxx/{diagnostics,numerics/c.math}
if they exist.
Sorry, I pulled commits from main :( |
✅ With the latest revision this PR passed the C/C++ code formatter. |
Now code diff's showing correct changes. But I'll probably need to create new PR to merge changes without extra commits... Added tests for implicit conversions and |
You can just rebase to fix your issues. |
Maybe I've done something wrong, but I've rebased and those all commits from main were added ahead of mine and appeared here... |
You probably did something wrong while rebasing. In a rebase workflow you want a single commit that you're force-pushing to your branch generally. It looks like you had a merge commit or something like that and the new commits got rebased onto that, resulting in different hashes; i.e. different commits. When running |
|
You should be able to |
443ff6f
to
18bc8ee
Compare
Many thanks, that worked! I should definitely read more documentation on how git rebase works and be more careful next time : ) |
a9a5c2a
to
3bf5f2d
Compare
Standard says that implementation of math functions that have floating-point-type parameter should provide an "overload for each cv-unqualified floating-point type".
3bf5f2d
to
a9955dc
Compare
So we should provide weaker floating-point overloads.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with a comment added.
…y are templates to be weaker than overloads provided by MSVC runtime.
Local branch amd-gfx bedba19 Merged main:ea2036e1e56b into amd-gfx:e1b9ddbd68c9 Remote branch main dc129d6 [libc++] Add std::fpclassify overloads for floating-point. (llvm#67913)
Standard says that implementation of math functions that have floating-point-type parameter should provide an "overload for each cv-unqualified floating-point type".