-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Closed
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzilladuplicateResolved as duplicateResolved as duplicatelibc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Description
| Bugzilla Link | 22707 |
| Resolution | DUPLICATE |
| Resolved on | Feb 26, 2015 08:02 |
| Version | unspecified |
| OS | Linux |
| CC | @mclow |
Extended Description
#include
struct A {
A(double x) : x(x) {}
operator double() const { return x; }
double x;
};
A a(1.0);
bool z = std::isfinite(a);
error: no matching function for call to 'isfinite'
bool z = std::isfinite(a);
^~~~~~~~~~~~~
/code/llvm/build/bin/../include/c++/v1/cmath:376:25: note: candidate template ignored: disabled by 'enable_if' [with _A1 = A]
typename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type
The Standard requires an overload of
bool isfinite(double x);
Instead, libc++ provides a template implementation with a SFINAE checking for an arithmetic type.
Metadata
Metadata
Assignees
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzilladuplicateResolved as duplicateResolved as duplicatelibc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.