Skip to content

Commit

Permalink
<ciso646> is removed in C++20 (microsoft#2710)
Browse files Browse the repository at this point in the history
Co-authored-by: Stephan T. Lavavej <[email protected]>
  • Loading branch information
fsb4000 and StephanTLavavej committed Aug 13, 2022
1 parent 89fcc6d commit f654296
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 3 deletions.
1 change: 1 addition & 0 deletions stl/inc/__msvc_all_public_headers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions stl/inc/ciso646
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@

#include <iso646.h>

_CXX20_REMOVE_CISO646 typedef int _Header_ciso646;
using _Hdr_ciso646 = _Header_ciso646;

#endif // _STL_COMPILER_PREPROCESSOR
#endif // _CISO646_
12 changes: 11 additions & 1 deletion stl/inc/yvals_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -1170,7 +1170,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: " \
"<ciso646> 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
Expand Down
1 change: 1 addition & 0 deletions tests/std/tests/P0088R3_variant/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/std/tests/P0220R1_any/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <msvc_stdlib_force_include.h> // Must precede any other libc++ headers
#include <stdlib.h>
Expand Down
1 change: 1 addition & 0 deletions tests/std/tests/P0220R1_optional/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <msvc_stdlib_force_include.h> // Must precede any other libc++ headers
#include <stdlib.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#include <cfloat>
#include <chrono>
#include <cinttypes>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
Expand Down
2 changes: 1 addition & 1 deletion tests/std/tests/include_each_header_alone_matrix.lst
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions tests/tr1/tests/ciso646/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

// test <ciso646>
#define _SILENCE_CXX20_CISO646_REMOVED_WARNING
#define TEST_NAME "<ciso646>"

#include "tdefs.h"
Expand Down

0 comments on commit f654296

Please sign in to comment.