[libcxx-commits] [libcxx] [libc++][math] Fix acceptance of convertible types in `std::isnan()` and `std::isinf()` (PR #98952)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Mon Aug 5 09:28:03 PDT 2024


================
@@ -705,15 +705,16 @@ void test_isinf()
     static_assert((std::is_same<decltype(std::isinf((float)0)), bool>::value), "");
 
     typedef decltype(std::isinf((double)0)) DoubleRetType;
-#if !defined(__linux__) || defined(__clang__)
-    static_assert((std::is_same<DoubleRetType, bool>::value), "");
-#else
+#if defined(__GLIBC__) && defined(_LIBCPP_CXX03_LANG) && !defined(_LIBCPP_PREFERRED_OVERLOAD)
----------------
ldionne wrote:

I think I would suggest only keeping the test changes in this patch, and changing this to

```
#if defined(__GLIBC__) && TEST_STD_VER == 03 && defined(TEST_COMPILER_CLANG)
```

https://github.com/llvm/llvm-project/pull/98952


More information about the libcxx-commits mailing list