diff --git a/stl/inc/__msvc_print.hpp b/stl/inc/__msvc_print.hpp index 5de74a0f2..b1b3a249d 100644 --- a/stl/inc/__msvc_print.hpp +++ b/stl/inc/__msvc_print.hpp @@ -8,6 +8,10 @@ #include #if _STL_COMPILER_PREPROCESSOR +#ifndef __cpp_lib_concepts // note: includes this header in C++20 mode +#error The contents of are available only with C++23. (Also, you should not include this internal header.) +#endif // ^^^ !defined(__cpp_lib_concepts) ^^^ + #include #include diff --git a/stl/inc/ostream b/stl/inc/ostream index 1a679cf01..de3b0a0fe 100644 --- a/stl/inc/ostream +++ b/stl/inc/ostream @@ -9,11 +9,11 @@ #if _STL_COMPILER_PREPROCESSOR #include -#if _HAS_CXX23 +#ifdef __cpp_lib_print #include <__msvc_filebuf.hpp> #include <__msvc_print.hpp> #include -#endif // _HAS_CXX23 +#endif // ^^^ defined(__cpp_lib_print) ^^^ #pragma pack(push, _CRT_PACKING) #pragma warning(push, _STL_WARNING_LEVEL) diff --git a/stl/inc/xcharconv.h b/stl/inc/xcharconv.h index cf352799e..07f6c2f87 100644 --- a/stl/inc/xcharconv.h +++ b/stl/inc/xcharconv.h @@ -8,14 +8,14 @@ #include #if _STL_COMPILER_PREPROCESSOR -#include -#include -#include - #if !_HAS_CXX17 #error The contents of are only available with C++17. (Also, you should not include this internal header.) #endif // !_HAS_CXX17 +#include +#include +#include + #pragma pack(push, _CRT_PACKING) #pragma warning(push, _STL_WARNING_LEVEL) #pragma warning(disable : _STL_DISABLED_WARNINGS) diff --git a/stl/inc/xcharconv_ryu.h b/stl/inc/xcharconv_ryu.h index fc29a3d48..343a09226 100644 --- a/stl/inc/xcharconv_ryu.h +++ b/stl/inc/xcharconv_ryu.h @@ -37,6 +37,10 @@ #include #if _STL_COMPILER_PREPROCESSOR +#if !_HAS_CXX17 +#error The contents of are only available with C++17. (Also, you should not include this internal header.) +#endif // !_HAS_CXX17 + #include #include #include @@ -54,10 +58,6 @@ #include _STL_INTRIN_HEADER // for _umul128() and __shiftright128() #endif // ^^^ intrinsics available ^^^ -#if !_HAS_CXX17 -#error The contents of are only available with C++17. (Also, you should not include this internal header.) -#endif // !_HAS_CXX17 - #pragma pack(push, _CRT_PACKING) #pragma warning(push, _STL_WARNING_LEVEL) #pragma warning(disable : _STL_DISABLED_WARNINGS) diff --git a/stl/inc/xcharconv_ryu_tables.h b/stl/inc/xcharconv_ryu_tables.h index ef01dd9e5..a8d4e5a7b 100644 --- a/stl/inc/xcharconv_ryu_tables.h +++ b/stl/inc/xcharconv_ryu_tables.h @@ -37,12 +37,12 @@ #include #if _STL_COMPILER_PREPROCESSOR -#include - #if !_HAS_CXX17 #error The contents of are only available with C++17. (Also, you should not include this internal header.) #endif // !_HAS_CXX17 +#include + #pragma pack(push, _CRT_PACKING) #pragma warning(push, _STL_WARNING_LEVEL) #pragma warning(disable : _STL_DISABLED_WARNINGS) diff --git a/stl/inc/xnode_handle.h b/stl/inc/xnode_handle.h index f7f685b25..2462a506e 100644 --- a/stl/inc/xnode_handle.h +++ b/stl/inc/xnode_handle.h @@ -7,12 +7,13 @@ #define _XNODE_HANDLE_H #include #if _STL_COMPILER_PREPROCESSOR -#include #if !_HAS_CXX17 #error Node handles are only available with C++17. (Also, you should not include this internal header.) #endif // _HAS_CXX17 +#include + #pragma pack(push, _CRT_PACKING) #pragma warning(push, _STL_WARNING_LEVEL) #pragma warning(disable : _STL_DISABLED_WARNINGS) diff --git a/tests/std/tests/GH_001411_core_headers/test.cpp b/tests/std/tests/GH_001411_core_headers/test.cpp index a3cbc49e9..1bf1d87f6 100644 --- a/tests/std/tests/GH_001411_core_headers/test.cpp +++ b/tests/std/tests/GH_001411_core_headers/test.cpp @@ -19,9 +19,9 @@ #include #endif // _HAS_CXX17 -#if _HAS_CXX23 +#ifdef __cpp_lib_concepts #include <__msvc_print.hpp> -#endif // _HAS_CXX23 +#endif // ^^^ defined(__cpp_lib_concepts) ^^^ // <__msvc_bit_utils.hpp> is included by and // <__msvc_iter_core.hpp> is included by