[libcxx-commits] [libcxx] [libc++] Workaround for a bug of overloads in MS UCRT's `<math.h>` (PR #149234)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Aug 1 08:41:13 PDT 2025
================
@@ -427,6 +427,23 @@ using std::__math::islessgreater;
using std::__math::isnan;
using std::__math::isnormal;
using std::__math::isunordered;
+# elif _LIBCPP_STD_VER >= 20
----------------
ldionne wrote:
Minor nit, but I would find this code block easier to read if we did this instead:
```
#ifndef _LIBCPP_MSVCRT
using std::__math::isfinite;
// etc...
#endif
#ifdef _LIBCPP_MSVCRT && _LIBCPP_STD_VER >= 20
using std::__math::__ucrt::isfinite;
// etc...
#endif
```
When looking at the code quickly, a stray `elif _LIBCPP_STD_VER >= 20` makes it look like the initial `#if` uptop was probably a `#if check-for-some-standard-version`, when in reality it's a platform-related check. I find that repeating the platform check makes this clearer.
Just a suggestion, not a requirement.
https://github.com/llvm/llvm-project/pull/149234
More information about the libcxx-commits
mailing list