[PATCH] D18639: Use __builtin_isnan/isinf/isfinite in complex

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Sat Sep 17 21:21:58 PDT 2016


EricWF accepted this revision.
EricWF added a comment.
This revision is now accepted and ready to land.

LGTM.

In https://reviews.llvm.org/D18639#514991, @hfinkel wrote:

> In https://reviews.llvm.org/D18639#491232, @mclow.lists wrote:
>
> > And is there any reason why `__libcpp_isinf` can't just return `false` for non-fp types?
>
>
> For custom numeric types that have an isinf, etc. found by ADL, they should continue to work.


Do we already support custom numeric types? If so could you add a test for this under `test/libcxx`? Just a simple test case that instantiates the functions and shows it compiles.


================
Comment at: include/cmath:593
@@ +592,3 @@
+_LIBCPP_ALWAYS_INLINE
+typename std::enable_if<!std::is_floating_point<_A1>::value, bool>::type
+__libcpp_isnan(_A1 __lcpp_x) _NOEXCEPT
----------------
nit: the `std::` qualifier on types is unnecessary.


https://reviews.llvm.org/D18639





More information about the cfe-commits mailing list