-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libc++ isnan(integer-type) broken on Windows with -std=c++20 after #69431 #70225
Comments
Do we still need this issue? I thought this was on Clang to fix long-term or is it not? |
The failing tests were XFAILED in #79619 |
Just ran into this issue when migrating to Clang c++20 for some windows code. I've retitled the bug to indicate what it's actually about now. In the MSVC UCRT headers, their math.h is actually intended to implement the full C++ spec requirements for the header. They don't expect the C++ stdlib to provide its own wrapper math.h for C++-specific functionality, and their STL does not do so -- unlike Unix implementations, where libc provides a math.h which only implement the C standard functions, and the C++ stdlib is expected to wrap it. Unfortunately, as the very-old microsoft/STL#519 issue records, their header is non-compliant with C++11, by not providing integer overloads for any of the floating-point functions like Thus, libc++ currently defines Unfortunately, the libc++ workaround to the MSVC header bug relies upon Because the MSVC math.h defines Now that we aren't using that nonstandard mode by default in In my opinion, the best thing for libc++ to do here would actually be to stop trying to workaround math.h bugs in MSVC -- and therefore become buggy by missing the integer overloads for isnan/etc unconditionally in MSVC mode, until MSVC fixes its math.h header. |
This has been fixed by adding the overloads to |
Is this still an issue? I don't see any MSVC-specific code around how we handle |
libcxx/fuzzing/random.pass.cpp
,std/depr/depr.c.headers/math_h.pass.cpp
andstd/numerics/c.math/cmath.pass.cpp
are all failing with tip-of-tree Clang after #69431 landed:The text was updated successfully, but these errors were encountered: