diff --git a/stl/inc/__msvc_all_public_headers.hpp b/stl/inc/__msvc_all_public_headers.hpp index b057b74fcbe..3d7a53d4724 100644 --- a/stl/inc/__msvc_all_public_headers.hpp +++ b/stl/inc/__msvc_all_public_headers.hpp @@ -35,6 +35,7 @@ #endif // TRANSITION, OS-17090155 (UCRT) #define _SILENCE_CXX17_C_HEADER_DEPRECATION_WARNING +#define _SILENCE_CXX20_CISO646_REMOVED_WARNING #define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING #define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS diff --git a/stl/inc/ciso646 b/stl/inc/ciso646 index 31615ef032f..02c3e72441a 100644 --- a/stl/inc/ciso646 +++ b/stl/inc/ciso646 @@ -11,5 +11,8 @@ #include +_CXX20_REMOVE_CISO646 typedef int _Header_ciso646; +using _Hdr_ciso646 = _Header_ciso646; + #endif // _STL_COMPILER_PREPROCESSOR #endif // _CISO646_ diff --git a/stl/inc/yvals_core.h b/stl/inc/yvals_core.h index 89fa6384562..7efe7546ab5 100644 --- a/stl/inc/yvals_core.h +++ b/stl/inc/yvals_core.h @@ -1171,7 +1171,17 @@ #define _CXX23_DEPRECATE_ALIGNED_UNION #endif // ^^^ warning disabled ^^^ -// next warning number: STL4036 +#if _HAS_CXX20 && !defined(_SILENCE_CXX20_CISO646_REMOVED_WARNING) && !defined(_SILENCE_ALL_CXX20_DEPRECATION_WARNINGS) +#define _CXX20_REMOVE_CISO646 \ + [[deprecated("warning STL4036: " \ + " is removed in C++20. " \ + "You can define _SILENCE_CXX20_CISO646_REMOVED_WARNING " \ + "or _SILENCE_ALL_CXX20_DEPRECATION_WARNINGS to acknowledge that you have received this warning.")]] +#else // ^^^ warning enabled / warning disabled vvv +#define _CXX20_REMOVE_CISO646 +#endif // ^^^ warning disabled ^^^ + +// next warning number: STL4037 // P0619R4 Removing C++17-Deprecated Features #ifndef _HAS_FEATURES_REMOVED_IN_CXX20 diff --git a/tests/std/tests/P0088R3_variant/test.cpp b/tests/std/tests/P0088R3_variant/test.cpp index 836a6edb920..278a47632fb 100644 --- a/tests/std/tests/P0088R3_variant/test.cpp +++ b/tests/std/tests/P0088R3_variant/test.cpp @@ -37,6 +37,7 @@ #define _HAS_DEPRECATED_RESULT_OF 1 #define _SILENCE_CXX17_RESULT_OF_DEPRECATION_WARNING +#define _SILENCE_CXX20_CISO646_REMOVED_WARNING #define _SILENCE_CXX20_VOLATILE_DEPRECATION_WARNING #define _SILENCE_CXX23_ALIGNED_UNION_DEPRECATION_WARNING #define _LIBCXX_IN_DEVCRT diff --git a/tests/std/tests/P0220R1_any/test.cpp b/tests/std/tests/P0220R1_any/test.cpp index 21545e4eed6..a13fe517d10 100644 --- a/tests/std/tests/P0220R1_any/test.cpp +++ b/tests/std/tests/P0220R1_any/test.cpp @@ -31,6 +31,7 @@ #define _HAS_DEPRECATED_IS_LITERAL_TYPE 1 #define _SILENCE_CXX17_IS_LITERAL_TYPE_DEPRECATION_WARNING +#define _SILENCE_CXX20_CISO646_REMOVED_WARNING #define _LIBCXX_IN_DEVCRT #include // Must precede any other libc++ headers #include diff --git a/tests/std/tests/P0220R1_optional/test.cpp b/tests/std/tests/P0220R1_optional/test.cpp index 648b147c6fd..bbd353ca3b2 100644 --- a/tests/std/tests/P0220R1_optional/test.cpp +++ b/tests/std/tests/P0220R1_optional/test.cpp @@ -34,6 +34,7 @@ #define _HAS_DEPRECATED_RESULT_OF 1 #define _SILENCE_CXX17_IS_LITERAL_TYPE_DEPRECATION_WARNING #define _SILENCE_CXX17_RESULT_OF_DEPRECATION_WARNING +#define _SILENCE_CXX20_CISO646_REMOVED_WARNING #define _LIBCXX_IN_DEVCRT #include // Must precede any other libc++ headers #include diff --git a/tests/std/tests/VSO_0000000_instantiate_iterators_misc/test.compile.pass.cpp b/tests/std/tests/VSO_0000000_instantiate_iterators_misc/test.compile.pass.cpp index 10f7e9a686f..6a0e87e6a60 100644 --- a/tests/std/tests/VSO_0000000_instantiate_iterators_misc/test.compile.pass.cpp +++ b/tests/std/tests/VSO_0000000_instantiate_iterators_misc/test.compile.pass.cpp @@ -32,7 +32,6 @@ #include #include #include -#include #include #include #include diff --git a/tests/std/tests/include_each_header_alone_matrix.lst b/tests/std/tests/include_each_header_alone_matrix.lst index 731434c1507..b6a08effe83 100644 --- a/tests/std/tests/include_each_header_alone_matrix.lst +++ b/tests/std/tests/include_each_header_alone_matrix.lst @@ -102,7 +102,7 @@ PM_CL="/DMEOW_HEADER=cerrno" PM_CL="/DMEOW_HEADER=cfenv" PM_CL="/DMEOW_HEADER=cfloat" PM_CL="/DMEOW_HEADER=cinttypes" -PM_CL="/DMEOW_HEADER=ciso646" +PM_CL="/DMEOW_HEADER=ciso646 /D_SILENCE_CXX20_CISO646_REMOVED_WARNING" PM_CL="/DMEOW_HEADER=climits" PM_CL="/DMEOW_HEADER=clocale" PM_CL="/DMEOW_HEADER=cmath" diff --git a/tests/tr1/tests/ciso646/test.cpp b/tests/tr1/tests/ciso646/test.cpp index e1bcce02988..a53f8b2dc66 100644 --- a/tests/tr1/tests/ciso646/test.cpp +++ b/tests/tr1/tests/ciso646/test.cpp @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // test +#define _SILENCE_CXX20_CISO646_REMOVED_WARNING #define TEST_NAME "" #include "tdefs.h"