<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/98816>98816</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[libc++] std::isfinite() does not accept convertible-to-float
</td>
</tr>
<tr>
<th>Labels</th>
<td>
libc++
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
AngryLoki
</td>
</tr>
</table>
<pre>
The following code works with libstdc++, fails with libc++:
```c++
#include <cmath>
struct X {
operator float();
};
bool test(X value) {
return std::isfinite(value);
}
```
Conformance viewer: https://godbolt.org/z/nK9sofToP
Long time ago probably the same issue was reported in https://github.com/llvm/llvm-project/issues/23081 and closed as a duplicate of https://github.com/llvm/llvm-project/issues/18592 . However the fix was applied only for `isnan` and `isinf` - see https://github.com/llvm/llvm-project/blob/fe7fc54403e17b17e366adaab75256b2269fc204/libcxx/include/__math/traits.h#L97-L110
Could you apply the same fix for `std::isfinite`?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykVE2P4zYM_TXyhUhgS_6IDz5kZ2oU6Bx62MPeFvqgYnUV0ZDkZNJfX9gzwWS2vbQFBNkyzUc-8ZEyJXcKiANrvrDmuZBLnigOx3CKtxf64QpF5jZ8nRAseU9XF06gySBcKf5IcHV5Au9UykYz_mVbT2Cl8x-2u0EcWfnMyiNry7d1N7x95cIF7ReDwMSTPss8MfHLu23bU46LzvANWPfuAwBAM0aZKYL1JDPjB8Z7Ju6g3fPH-7YrIg8Z0_rnN7hIvyDj_WfIiHmJAVI2a87i6JJ1wWVk_HB3-BThM6vHaE8ULMWzDBrh4vCKkYkjTDnPaYXmI-PjiYwin_cUT4yPfzI-ht_6RPYr_f4I9ULhBNmdEeSJYI6kpPI3yBNCkmcEl9KCcJUJIs4UMxpw4edQLk-L2ms6Mz56f7k_dnOkP1BnxscNJjE-clEeKpDBgPaU0IBMIMEss3daZgSy_wO8OjQ9hz38Sle8YNxYWPe6pS_n2Ts0QMHfwFIE1pYuBRlYW275bGcX7HreQUL894koT4rx0WJndVPXpcCqU1WHom2lkVJ1DW9axXnbW83LegVwSr--rhzeRMr4-P37JlI-5ihdTvuJcfHSd7uXqvpJBIs3cKNlo_ZQspXxO8G_a60tmRgLMwjTi14WOFQdL_u2rRpRTMOhxa7usC9F1eiq6lRvkSMvlaoa28u-cAMveV12VV3VZV-Jve0OlTbtxtaKWrC6xLN0fr9ezSq-YqvO0B8OVVt4qdCnbShw_tDDnK9DIg7bfarllFhdepdy-oDJLvttnDy4Nc__2E1r5xnCBIEySK1xzqApXDBmpzzuMu22ri6W6If_rrY3SpeB_xUAAP__a6qECA">