[PATCH] D31561: cmath: Skip Libc for integral types in isinf, etc.

Marshall Clow via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 18 16:44:59 PDT 2017


mclow.lists added inline comments.


================
Comment at: libcxx/include/math.h:400
+inline _LIBCPP_INLINE_VISIBILITY
+typename std::enable_if<std::is_integral<_A1>::value, int>::type
+fpclassify(_A1 __lcpp_x) _NOEXCEPT
----------------
hfinkel wrote:
> Maybe we should predicate this, and other infinity-related functions, on std::numeric_limits<_A1>::has_infinity. That seems more general, and safer for potential user-defined types.
I don't think we need to worry about user-defined types.  The standard limits the parameters to "arithmetic types" and in [basic.fundamental] it lists exactly what those types are.  


https://reviews.llvm.org/D31561





More information about the cfe-commits mailing list