Describe the bug
In C++20 mode, MSVC reports an STL4038 warning regarding <stdfloat> when compiling Cpp1 code that was generated by Cppfront with the -include-std flag.
To Reproduce
Run Cppfront with the -in or -include-std flag on this code:
main: () -> int = {
return 0;
}
Then compile the result with MSVC with /std:c++20.
stdfloat(12): warning STL4038: The contents of <stdfloat> are available only with C++23 or later.
Additional context
In cpp2util.h the test for including <stdfloat> is:
#if __has_include(<stdfloat>)
This returns true even when building for C++20 with MSVC, and the <stdfloat> header contains this:
#if !_HAS_CXX23
_EMIT_STL_WARNING(STL4038, "The contents of <stdfloat> are available only with C++23 or later.");
#else // ^^^ !_HAS_CXX23 / _HAS_CXX23 vvv
Describe the bug In C++20 mode, MSVC reports an
STL4038
warning regarding<stdfloat>
when compiling Cpp1 code that was generated by Cppfront with the-include-std
flag.To Reproduce Run Cppfront with the
-in
or-include-std
flag on this code:Then compile the result with MSVC with
/std:c++20
.See here on Godbolt.
This warning is emitted:
Additional context In
cpp2util.h
the test for including<stdfloat>
is:This returns true even when building for C++20 with MSVC, and the
<stdfloat>
header contains this: