Add a Standard mode check to <__msvc_print.hpp>
#4111
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
<__msvc_print.hpp>
was missing the Standard mode check that the rest of our internal headers perform. This one's a little special because it's included by<format>
in C++20 Concepts mode, and by<print>
in C++23 Concepts mode.Without this check, the header is still rejected in C++14/17 mode, but with a less clear error about the usage of
consteval
:STL/stl/inc/__msvc_print.hpp
Line 58 in 1c59a20
Also, this moves the other Standard mode checks in
<xmeow.h>
as early as possible. The mode is available after including<yvals_core.h>
, and if we're doomed, we should diagnose doom immediately.<xcharconv_tables.h>
was already doing this.Next,
<ostream>
was guarding its inclusion of<__msvc_print.hpp>
with#if _HAS_CXX23
, even though its usage was guarded with#ifdef __cpp_lib_print
:STL/stl/inc/ostream
Line 1085 in adea8d5
This meant that in our test suite, EDG in C++23 non-concepts mode had
<ostream>
including<__msvc_print.hpp>
and then doing nothing with it. That was previously harmless but is now an error, so we need to make the guards consistent. (I don't think<ostream>
's dependency needs to be mentioned in the<__msvc_print.hpp>
error message, that would just be confusing and it wouldn't be why users were trying to include the thing.)Finally,
GH_001411_core_headers
was guarding with#if _HAS_CXX23
, which was both too restrictive (the header is used by<format>
in C++20) and too permissive (the header is used only in Concepts mode). We need to change this to#ifdef __cpp_lib_concepts
.Thanks to @ThomasFWise for the report!