-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Closed
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillalibc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Description
| Bugzilla Link | 18218 |
| Version | unspecified |
| OS | All |
| Depends On | #18759 |
| Reporter | LLVM Bugzilla Contributor |
| CC | @dlj-NaN,@eugenis,@K-ballo,@mclow,@zygoloid,@seanm |
Extended Description
The standard specifies in [c.math] that isnan and other classification functions must have the following overloads:
bool isnan(float x);
bool isnan(double x);
bool isnan(long double x);
Implementing it as a template seems like a good idea, except that the following valid code is rejected:
#include
struct A {
operator float() { return 0.0; }
};
int main() {
std::isnan(A());
}
The template should be enabled for every type that is convertible to an arithmetic type, to make the implementation indistinguishable from what is specified in the standard.
Metadata
Metadata
Assignees
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillalibc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.