From 0bf216b5cb0996e0503b6b67621e342e774c3653 Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Fri, 18 Aug 2023 04:32:44 +0300 Subject: [PATCH 01/21] Update `#else` transition comment (#3951) --- stl/inc/system_error | 6 +++--- stl/src/excptptr.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/stl/inc/system_error b/stl/inc/system_error index 18ee8527ced..096447c7c10 100644 --- a/stl/inc/system_error +++ b/stl/inc/system_error @@ -654,7 +654,7 @@ _NODISCARD const _Ty& _Immortalize_memcpy_image() noexcept { [[_Clang::__require_constant_initialization__]] static _Ty _Static; return _Static; } -#elif !defined(_M_CEE) // TRANSITION, VSO-1153256 +#elif !defined(_M_CEE) template struct _Constexpr_immortalize_impl { union { @@ -676,7 +676,7 @@ _NODISCARD const _Ty& _Immortalize_memcpy_image() noexcept { static _Constexpr_immortalize_impl<_Ty> _Static; return _Static._Storage; } -#else // ^^^ no workaround / workaround vvv +#else // ^^^ !defined(_M_CEE) / defined(_M_CEE), TRANSITION, VSO-1153256 vvv template _NODISCARD const _Ty& _Immortalize_memcpy_image() noexcept { // return reference to a memcpy'd default-initialized _Ty @@ -695,7 +695,7 @@ _NODISCARD const _Ty& _Immortalize_memcpy_image() noexcept { _Storage[0].store(_Target_iter[0], memory_order_release); return reinterpret_cast<_Ty&>(_Storage); } -#endif // choose immortalize strategy +#endif // ^^^ defined(_M_CEE), TRANSITION, VSO-1153256 ^^^ _EXPORT_STD _NODISCARD inline const error_category& generic_category() noexcept { return _Immortalize_memcpy_image<_Generic_error_category>(); diff --git a/stl/src/excptptr.cpp b/stl/src/excptptr.cpp index 929bfff7eb5..5cfc8406419 100644 --- a/stl/src/excptptr.cpp +++ b/stl/src/excptptr.cpp @@ -43,7 +43,7 @@ namespace { /* MAGIC */ static _Immortalizer_impl<_Ty> _Static; return reinterpret_cast<_Ty&>(_Static._Storage); } -#elif !defined(_M_CEE) // _M_CEE test is TRANSITION, VSO-1153256 +#elif !defined(_M_CEE) template struct _Constexpr_excptptr_immortalize_impl { union { @@ -67,7 +67,7 @@ namespace { [[nodiscard]] _Ty& _Immortalize() noexcept { return _Immortalize_impl<_Ty>._Storage; } -#else // choose immortalize strategy +#else // ^^^ !defined(_M_CEE) / defined(_M_CEE), TRANSITION, VSO-1153256 vvv template int __stdcall _Immortalize_impl(void*, void* _Storage_ptr, void**) noexcept { // adapt True Placement New to _Execute_once @@ -86,7 +86,7 @@ namespace { return reinterpret_cast<_Ty&>(_Storage); } -#endif // _M_CEE_PURE +#endif // ^^^ !defined(_M_CEE_PURE) && defined(_M_CEE), TRANSITION, VSO-1153256 ^^^ void _PopulateCppExceptionRecord( _EXCEPTION_RECORD& _Record, const void* const _PExcept, ThrowInfo* _PThrow) noexcept { From 21eca6fc977a1ac8a430c41cdbd9b230ff250933 Mon Sep 17 00:00:00 2001 From: achabense <60953653+achabense@users.noreply.github.com> Date: Fri, 18 Aug 2023 09:35:22 +0800 Subject: [PATCH 02/21] Fix `string::assign` and `::resize_and_overwrite` under ASan (#3956) Co-authored-by: Casey Carter --- stl/inc/xstring | 20 ++++++++++--------- .../GH_002030_asan_annotate_string/test.cpp | 12 +++++++++++ 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/stl/inc/xstring b/stl/inc/xstring index bfd9d09b3ac..ae566f24af1 100644 --- a/stl/inc/xstring +++ b/stl/inc/xstring @@ -3371,11 +3371,12 @@ public: _In_reads_(_Count) const _Elem* const _Ptr, _CRT_GUARDOVERFLOW const size_type _Count) { // assign [_Ptr, _Ptr + _Count) if (_Count <= _Mypair._Myval2._Myres) { - _ASAN_STRING_MODIFY(*this, _Mypair._Myval2._Mysize, _Count); + _ASAN_STRING_REMOVE(*this); _Elem* const _Old_ptr = _Mypair._Myval2._Myptr(); _Mypair._Myval2._Mysize = _Count; _Traits::move(_Old_ptr, _Ptr, _Count); _Traits::assign(_Old_ptr[_Count], _Elem()); + _ASAN_STRING_CREATE(*this); return *this; } @@ -4141,8 +4142,6 @@ public: } } -#pragma warning(push) -#pragma warning(disable : 4018) // '<=': signed/unsigned mismatch (we compare to 0 before _New_size below, so it's safe) template constexpr void #if _HAS_CXX23 @@ -4156,18 +4155,21 @@ public: [](_Elem* const _New_ptr, const _Elem* const _Old_ptr, const size_type _Old_size) { _Traits::copy(_New_ptr, _Old_ptr, _Old_size + 1); }); + } else { + _ASAN_STRING_MODIFY(*this, _Mypair._Myval2._Mysize, _New_size); + _Mypair._Myval2._Mysize = _New_size; } - auto _Arg_ptr = _Mypair._Myval2._Myptr(); - auto _Arg_size = _New_size; - const auto _Result_size = _STD move(_Op)(_Arg_ptr, _Arg_size); + auto _Arg_ptr = _Mypair._Myval2._Myptr(); + auto _Arg_size = _New_size; + const auto _Result_size = _STD move(_Op)(_Arg_ptr, _Arg_size); + const auto _Result_as_size_type = static_cast(_Result_size); #if _CONTAINER_DEBUG_LEVEL > 0 _STL_VERIFY(_Result_size >= 0, "the returned size can't be smaller than 0"); - _STL_VERIFY(_Result_size <= _New_size, "the returned size can't be greater than the passed size"); + _STL_VERIFY(_Result_as_size_type <= _New_size, "the returned size can't be greater than the passed size"); #endif // _CONTAINER_DEBUG_LEVEL > 0 - _Eos(static_cast(_Result_size)); + _Eos(_Result_as_size_type); } -#pragma warning(pop) #if _HAS_CXX23 template diff --git a/tests/std/tests/GH_002030_asan_annotate_string/test.cpp b/tests/std/tests/GH_002030_asan_annotate_string/test.cpp index ae8fd17f331..eb1d4127c12 100644 --- a/tests/std/tests/GH_002030_asan_annotate_string/test.cpp +++ b/tests/std/tests/GH_002030_asan_annotate_string/test.cpp @@ -1920,6 +1920,17 @@ void test_gh_3883() { assert(t == "AAAAAAA"); } +void test_gh_3955() { + // GH-3955 : ASAN report container-overflow in a legal case + string s(19, '0'); + s = &s[3]; + assert(s == string(16, '0')); + + string t(19, '0'); + s = &t[0]; + assert(s == t); +} + int main() { run_allocator_matrix(); #ifdef __cpp_char8_t @@ -1932,4 +1943,5 @@ int main() { test_DevCom_10116361(); test_DevCom_10109507(); test_gh_3883(); + test_gh_3955(); } From 292ff9bc68fa2e1f2955f34f8546535643985102 Mon Sep 17 00:00:00 2001 From: grcm10 <141476191+grcm10@users.noreply.github.com> Date: Fri, 18 Aug 2023 10:42:13 +0900 Subject: [PATCH 03/21] Replace `if` with `if constexpr` (#3958) --- stl/inc/__msvc_chrono.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stl/inc/__msvc_chrono.hpp b/stl/inc/__msvc_chrono.hpp index ddb838978ce..e3f8a813d4f 100644 --- a/stl/inc/__msvc_chrono.hpp +++ b/stl/inc/__msvc_chrono.hpp @@ -428,15 +428,15 @@ namespace chrono { constexpr bool _Num_is_one = _CF::num == 1; constexpr bool _Den_is_one = _CF::den == 1; - if (_Den_is_one) { - if (_Num_is_one) { + if constexpr (_Den_is_one) { + if constexpr (_Num_is_one) { return static_cast<_To>(static_cast<_ToRep>(_Dur.count())); } else { return static_cast<_To>( static_cast<_ToRep>(static_cast<_CR>(_Dur.count()) * static_cast<_CR>(_CF::num))); } } else { - if (_Num_is_one) { + if constexpr (_Num_is_one) { return static_cast<_To>( static_cast<_ToRep>(static_cast<_CR>(_Dur.count()) / static_cast<_CR>(_CF::den))); } else { From c7a90d744bc2e02e7bf0f91ea24fde7758eda03b Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Thu, 17 Aug 2023 18:45:24 -0700 Subject: [PATCH 04/21] Fix bad tr1/algorithm test cases (#3967) --- tests/tr1/tests/algorithm/test.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/tr1/tests/algorithm/test.cpp b/tests/tr1/tests/algorithm/test.cpp index 8a0d2d339af..78683be0893 100644 --- a/tests/tr1/tests/algorithm/test.cpp +++ b/tests/tr1/tests/algorithm/test.cpp @@ -105,8 +105,8 @@ void test_find(char* first, char* last) { // test searching template functions CHECK(STD is_permutation(first, last, p1, p1 + 7)); CHECK(!STD is_permutation(first, last, p1, p1 + CSTD strlen(p1))); const char* p2 = "abcgfedxx"; - CHECK(!STD is_permutation(first, last, p2 + 7)); - CHECK(!STD is_permutation(first, last, p2 + CSTD strlen(p2))); + CHECK(!STD is_permutation(first, last, p2, p2 + 7)); + CHECK(!STD is_permutation(first, last, p2, p2 + CSTD strlen(p2))); CHECK(STD is_permutation(first, last, first, last, &cmp_chars)); const char* p3 = "aBCgfecxx"; From 60f18856c56389001c38a9929ef37bd5c01c4e47 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Fri, 18 Aug 2023 08:48:39 +0700 Subject: [PATCH 05/21] Update boost-math to 1.83 (#3952) --- boost-math | 2 +- docs/cgmanifest.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/boost-math b/boost-math index c56f334348d..1a7be5d895d 160000 --- a/boost-math +++ b/boost-math @@ -1 +1 @@ -Subproject commit c56f334348d5476783fba996d604fc5c6ae980c3 +Subproject commit 1a7be5d895d266a870af7a6ed258e5bcf9838277 diff --git a/docs/cgmanifest.json b/docs/cgmanifest.json index d6f5dd7612f..9a65588b24e 100644 --- a/docs/cgmanifest.json +++ b/docs/cgmanifest.json @@ -6,7 +6,7 @@ "type": "git", "git": { "repositoryUrl": "https://github.com/boostorg/math", - "commitHash": "c56f334348d5476783fba996d604fc5c6ae980c3" + "commitHash": "1a7be5d895d266a870af7a6ed258e5bcf9838277" } } }, From 782dcd536a57fd5c6a215d1b9a3014ba4c25282f Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Wed, 30 Aug 2023 10:19:43 -0700 Subject: [PATCH 06/21] Make the constexpr mutex constructor opt-in (#4000) ... via defining `_ENABLE_CONSTEXPR_MUTEX_CONSTRUCTOR`, instead of opt-out via `_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR`. This avoids potential breakage until we can update the VCLibs UWP framework libraries. --- stl/inc/mutex | 12 ++++++------ tests/std/tests/VSO_0226079_mutex/env.lst | 2 +- tests/std/tests/VSO_0226079_mutex/test.cpp | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/stl/inc/mutex b/stl/inc/mutex index b133a8c1ce6..4954d7c3389 100644 --- a/stl/inc/mutex +++ b/stl/inc/mutex @@ -32,18 +32,18 @@ _EXPORT_STD class condition_variable_any; class _Mutex_base { // base class for all mutex types public: -#ifdef _DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR - _Mutex_base(int _Flags = 0) noexcept { - _Mtx_init_in_situ(_Mymtx(), _Flags | _Mtx_try); - } -#else // ^^^ _DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR / !_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR vvv +#ifdef _ENABLE_CONSTEXPR_MUTEX_CONSTRUCTOR constexpr _Mutex_base(int _Flags = 0) noexcept { _Mtx_storage._Critical_section = {}; _Mtx_storage._Thread_id = -1; _Mtx_storage._Type = _Flags | _Mtx_try; _Mtx_storage._Count = 0; } -#endif // !_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR +#else // ^^^ _ENABLE_CONSTEXPR_MUTEX_CONSTRUCTOR / !_ENABLE_CONSTEXPR_MUTEX_CONSTRUCTOR vvv + _Mutex_base(int _Flags = 0) noexcept { + _Mtx_init_in_situ(_Mymtx(), _Flags | _Mtx_try); + } +#endif // !_ENABLE_CONSTEXPR_MUTEX_CONSTRUCTOR ~_Mutex_base() noexcept { _Mtx_destroy_in_situ(_Mymtx()); diff --git a/tests/std/tests/VSO_0226079_mutex/env.lst b/tests/std/tests/VSO_0226079_mutex/env.lst index 371ea99ecab..1fb3203d028 100644 --- a/tests/std/tests/VSO_0226079_mutex/env.lst +++ b/tests/std/tests/VSO_0226079_mutex/env.lst @@ -3,5 +3,5 @@ RUNALL_INCLUDE ..\impure_matrix.lst RUNALL_CROSSLIST -PM_CL="/D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR" +PM_CL="/D_ENABLE_CONSTEXPR_MUTEX_CONSTRUCTOR" PM_CL="" diff --git a/tests/std/tests/VSO_0226079_mutex/test.cpp b/tests/std/tests/VSO_0226079_mutex/test.cpp index dd412444014..dd84dd39d93 100644 --- a/tests/std/tests/VSO_0226079_mutex/test.cpp +++ b/tests/std/tests/VSO_0226079_mutex/test.cpp @@ -468,7 +468,7 @@ void test_vso_1253916() { do_shared_locked_things(shared_lock{mtx}); } -#ifndef _DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR +#ifdef _ENABLE_CONSTEXPR_MUTEX_CONSTRUCTOR struct test_constexpr_ctor { constexpr test_constexpr_ctor() {} mutex mtx; @@ -478,7 +478,7 @@ test_constexpr_ctor obj; #if _HAS_CXX20 && !defined(_M_CEE) constinit test_constexpr_ctor obj2; #endif // _HAS_CXX20 && !defined(_M_CEE) -#endif // !_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR +#endif // _ENABLE_CONSTEXPR_MUTEX_CONSTRUCTOR int main() { { From 40e1eac0e182f76fb449f672ea29a98f25573f0c Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Fri, 1 Sep 2023 00:06:44 +0800 Subject: [PATCH 07/21] Deprecate the contents in `` headers (#3924) * Deprecate the contents in `` headers Also make the deprecation of Microsoft extensions controlled by `_SILENCE_ALL_MS_EXT_DEPRECATION_WARNINGS`. * Centralize suppression in `tests/tr1/tests/cvt/env.lst`. * Improve message grammar. --------- Co-authored-by: Stephan T. Lavavej --- stl/inc/cvt/8859_1 | 4 ++-- stl/inc/cvt/8859_10 | 4 ++-- stl/inc/cvt/8859_13 | 4 ++-- stl/inc/cvt/8859_14 | 4 ++-- stl/inc/cvt/8859_15 | 4 ++-- stl/inc/cvt/8859_16 | 4 ++-- stl/inc/cvt/8859_2 | 4 ++-- stl/inc/cvt/8859_3 | 4 ++-- stl/inc/cvt/8859_4 | 4 ++-- stl/inc/cvt/8859_5 | 4 ++-- stl/inc/cvt/8859_6 | 4 ++-- stl/inc/cvt/8859_7 | 4 ++-- stl/inc/cvt/8859_8 | 4 ++-- stl/inc/cvt/8859_9 | 4 ++-- stl/inc/cvt/baltic | 4 ++-- stl/inc/cvt/big5 | 4 ++-- stl/inc/cvt/cp037 | 4 ++-- stl/inc/cvt/cp1006 | 4 ++-- stl/inc/cvt/cp1026 | 4 ++-- stl/inc/cvt/cp1250 | 4 ++-- stl/inc/cvt/cp1251 | 4 ++-- stl/inc/cvt/cp1252 | 4 ++-- stl/inc/cvt/cp1253 | 4 ++-- stl/inc/cvt/cp1254 | 4 ++-- stl/inc/cvt/cp1255 | 4 ++-- stl/inc/cvt/cp1256 | 4 ++-- stl/inc/cvt/cp1257 | 4 ++-- stl/inc/cvt/cp1258 | 4 ++-- stl/inc/cvt/cp424 | 4 ++-- stl/inc/cvt/cp437 | 4 ++-- stl/inc/cvt/cp500 | 4 ++-- stl/inc/cvt/cp737 | 4 ++-- stl/inc/cvt/cp775 | 4 ++-- stl/inc/cvt/cp850 | 4 ++-- stl/inc/cvt/cp852 | 4 ++-- stl/inc/cvt/cp855 | 4 ++-- stl/inc/cvt/cp856 | 4 ++-- stl/inc/cvt/cp857 | 4 ++-- stl/inc/cvt/cp860 | 4 ++-- stl/inc/cvt/cp861 | 4 ++-- stl/inc/cvt/cp862 | 4 ++-- stl/inc/cvt/cp863 | 4 ++-- stl/inc/cvt/cp864 | 4 ++-- stl/inc/cvt/cp865 | 4 ++-- stl/inc/cvt/cp866 | 4 ++-- stl/inc/cvt/cp869 | 4 ++-- stl/inc/cvt/cp874 | 4 ++-- stl/inc/cvt/cp875 | 4 ++-- stl/inc/cvt/cp932 | 4 ++-- stl/inc/cvt/cp936 | 4 ++-- stl/inc/cvt/cp949 | 4 ++-- stl/inc/cvt/cp950 | 4 ++-- stl/inc/cvt/cyrillic | 4 ++-- stl/inc/cvt/ebcdic | 4 ++-- stl/inc/cvt/euc | 4 ++-- stl/inc/cvt/euc_0208 | 4 ++-- stl/inc/cvt/gb12345 | 4 ++-- stl/inc/cvt/gb2312 | 4 ++-- stl/inc/cvt/greek | 4 ++-- stl/inc/cvt/iceland | 4 ++-- stl/inc/cvt/jis | 4 ++-- stl/inc/cvt/jis0201 | 4 ++-- stl/inc/cvt/jis_0208 | 4 ++-- stl/inc/cvt/ksc5601 | 4 ++-- stl/inc/cvt/latin2 | 4 ++-- stl/inc/cvt/one_one | 4 ++-- stl/inc/cvt/roman | 4 ++-- stl/inc/cvt/sjis | 4 ++-- stl/inc/cvt/sjis_0208 | 4 ++-- stl/inc/cvt/turkish | 4 ++-- stl/inc/cvt/utf16 | 4 ++-- stl/inc/cvt/utf8 | 4 ++-- stl/inc/cvt/utf8_utf16 | 4 ++-- stl/inc/cvt/wbuffer | 4 ++-- stl/inc/cvt/wstring | 4 ++-- stl/inc/cvt/xjis | 4 ++-- stl/inc/cvt/xone_byte | 4 ++-- stl/inc/cvt/xtwo_byte | 4 ++-- stl/inc/yvals_core.h | 21 ++++++++++++++----- .../test.compile.pass.cpp | 1 + tests/std/tests/P0218R1_filesystem/test.cpp | 2 ++ .../test.compile.pass.cpp | 1 + tests/tr1/tests/cvt/env.lst | 2 ++ 83 files changed, 178 insertions(+), 161 deletions(-) diff --git a/stl/inc/cvt/8859_1 b/stl/inc/cvt/8859_1 index b3611970e32..591da9db589 100644 --- a/stl/inc/cvt/8859_1 +++ b/stl/inc/cvt/8859_1 @@ -63,7 +63,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_8859_1 { enum { _Nlow = 0x100, _Nbytes = 1 }; @@ -86,7 +86,7 @@ namespace stdext { const unsigned char _tab_8859_1<_Dummy>::_Wtb[1] = {0}; template class codecvt_8859_1 : public _Cvt_one_byte<_Elem, _tab_8859_1, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/8859_10 b/stl/inc/cvt/8859_10 index cdec0235311..5309cfcf879 100644 --- a/stl/inc/cvt/8859_10 +++ b/stl/inc/cvt/8859_10 @@ -63,7 +63,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_8859_10 { enum { _Nlow = 0xa1, _Nbytes = 1 }; @@ -105,7 +105,7 @@ namespace stdext { template class codecvt_8859_10 : public _Cvt_one_byte<_Elem, _tab_8859_10, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/8859_13 b/stl/inc/cvt/8859_13 index 5bba2abccc9..7569faeb0d4 100644 --- a/stl/inc/cvt/8859_13 +++ b/stl/inc/cvt/8859_13 @@ -59,7 +59,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_8859_13 { enum { _Nlow = 0xa1, _Nbytes = 1 }; @@ -103,7 +103,7 @@ namespace stdext { template class codecvt_8859_13 : public _Cvt_one_byte<_Elem, _tab_8859_13, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/8859_14 b/stl/inc/cvt/8859_14 index abf8b6dcad9..f1bec695747 100644 --- a/stl/inc/cvt/8859_14 +++ b/stl/inc/cvt/8859_14 @@ -60,7 +60,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_8859_14 { enum { _Nlow = 0xa1, _Nbytes = 1 }; @@ -100,7 +100,7 @@ namespace stdext { template class codecvt_8859_14 : public _Cvt_one_byte<_Elem, _tab_8859_14, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/8859_15 b/stl/inc/cvt/8859_15 index 101a5917617..5ca529a98ea 100644 --- a/stl/inc/cvt/8859_15 +++ b/stl/inc/cvt/8859_15 @@ -62,7 +62,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_8859_15 { enum { _Nlow = 0xa4, _Nbytes = 1 }; @@ -98,7 +98,7 @@ namespace stdext { template class codecvt_8859_15 : public _Cvt_one_byte<_Elem, _tab_8859_15, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/8859_16 b/stl/inc/cvt/8859_16 index 86b43970d23..d0bf158cb11 100644 --- a/stl/inc/cvt/8859_16 +++ b/stl/inc/cvt/8859_16 @@ -59,7 +59,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_8859_16 { enum { _Nlow = 0xa1, _Nbytes = 1 }; @@ -101,7 +101,7 @@ namespace stdext { template class codecvt_8859_16 : public _Cvt_one_byte<_Elem, _tab_8859_16, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/8859_2 b/stl/inc/cvt/8859_2 index a77ded35224..3a7b84cfcd1 100644 --- a/stl/inc/cvt/8859_2 +++ b/stl/inc/cvt/8859_2 @@ -63,7 +63,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_8859_2 { enum { _Nlow = 0xa1, _Nbytes = 1 }; @@ -107,7 +107,7 @@ namespace stdext { template class codecvt_8859_2 : public _Cvt_one_byte<_Elem, _tab_8859_2, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/8859_3 b/stl/inc/cvt/8859_3 index 8693ce8e00f..20c10f2504f 100644 --- a/stl/inc/cvt/8859_3 +++ b/stl/inc/cvt/8859_3 @@ -63,7 +63,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_8859_3 { enum { _Nlow = 0xa1, _Nbytes = 1 }; @@ -103,7 +103,7 @@ namespace stdext { template class codecvt_8859_3 : public _Cvt_one_byte<_Elem, _tab_8859_3, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/8859_4 b/stl/inc/cvt/8859_4 index b166034b88b..097700c210e 100644 --- a/stl/inc/cvt/8859_4 +++ b/stl/inc/cvt/8859_4 @@ -63,7 +63,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_8859_4 { enum { _Nlow = 0xa1, _Nbytes = 1 }; @@ -105,7 +105,7 @@ namespace stdext { template class codecvt_8859_4 : public _Cvt_one_byte<_Elem, _tab_8859_4, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/8859_5 b/stl/inc/cvt/8859_5 index d08555b0ebe..2f5964c5d6b 100644 --- a/stl/inc/cvt/8859_5 +++ b/stl/inc/cvt/8859_5 @@ -63,7 +63,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_8859_5 { enum { _Nlow = 0xa1, _Nbytes = 1 }; @@ -113,7 +113,7 @@ namespace stdext { template class codecvt_8859_5 : public _Cvt_one_byte<_Elem, _tab_8859_5, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/8859_6 b/stl/inc/cvt/8859_6 index 3adbcac6c28..68966a25f4d 100644 --- a/stl/inc/cvt/8859_6 +++ b/stl/inc/cvt/8859_6 @@ -65,7 +65,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_8859_6 { enum { _Nlow = 0xa1, _Nbytes = 1 }; @@ -107,7 +107,7 @@ namespace stdext { template class codecvt_8859_6 : public _Cvt_one_byte<_Elem, _tab_8859_6, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/8859_7 b/stl/inc/cvt/8859_7 index b78a2cafb19..ec0b800893a 100644 --- a/stl/inc/cvt/8859_7 +++ b/stl/inc/cvt/8859_7 @@ -68,7 +68,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_8859_7 { enum { _Nlow = 0xa1, _Nbytes = 1 }; @@ -114,7 +114,7 @@ namespace stdext { template class codecvt_8859_7 : public _Cvt_one_byte<_Elem, _tab_8859_7, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/8859_8 b/stl/inc/cvt/8859_8 index 94176207bfe..538b9b4cc70 100644 --- a/stl/inc/cvt/8859_8 +++ b/stl/inc/cvt/8859_8 @@ -65,7 +65,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_8859_8 { enum { _Nlow = 0xa1, _Nbytes = 1 }; @@ -105,7 +105,7 @@ namespace stdext { template class codecvt_8859_8 : public _Cvt_one_byte<_Elem, _tab_8859_8, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/8859_9 b/stl/inc/cvt/8859_9 index ebbc556009f..5af1f93317f 100644 --- a/stl/inc/cvt/8859_9 +++ b/stl/inc/cvt/8859_9 @@ -65,7 +65,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_8859_9 { enum { _Nlow = 0xd0, _Nbytes = 1 }; @@ -97,7 +97,7 @@ namespace stdext { template class codecvt_8859_9 : public _Cvt_one_byte<_Elem, _tab_8859_9, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/baltic b/stl/inc/cvt/baltic index 1540d64b152..62f0140c841 100644 --- a/stl/inc/cvt/baltic +++ b/stl/inc/cvt/baltic @@ -31,7 +31,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_baltic { enum { _Nlow = 0xa1, _Nbytes = 1 }; @@ -75,7 +75,7 @@ namespace stdext { template class codecvt_baltic : public _Cvt_one_byte<_Elem, _tab_baltic, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/big5 b/stl/inc/cvt/big5 index 271c88dd068..c065eab60b8 100644 --- a/stl/inc/cvt/big5 +++ b/stl/inc/cvt/big5 @@ -121,7 +121,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_big5 { enum { _Nlow = 0x80, _Nbytes = 2 }; @@ -4379,7 +4379,7 @@ namespace stdext { template class codecvt_big5 : public _Cvt_two_byte<_Elem, _tab_big5, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/cp037 b/stl/inc/cvt/cp037 index 13942239097..4470f1a5079 100644 --- a/stl/inc/cvt/cp037 +++ b/stl/inc/cvt/cp037 @@ -34,7 +34,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_cp037 { enum { _Nlow = 0x04, _Nbytes = 1 }; @@ -118,7 +118,7 @@ namespace stdext { template class codecvt_cp037 : public _Cvt_one_byte<_Elem, _tab_cp037, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/cp1006 b/stl/inc/cvt/cp1006 index e4679b57e28..dacee4667ea 100644 --- a/stl/inc/cvt/cp1006 +++ b/stl/inc/cvt/cp1006 @@ -62,7 +62,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_cp1006 { enum { _Nlow = 0xa1, _Nbytes = 1 }; @@ -112,7 +112,7 @@ namespace stdext { template class codecvt_cp1006 : public _Cvt_one_byte<_Elem, _tab_cp1006, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/cp1026 b/stl/inc/cvt/cp1026 index a2649e0e501..26f2be4900d 100644 --- a/stl/inc/cvt/cp1026 +++ b/stl/inc/cvt/cp1026 @@ -34,7 +34,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_cp1026 { enum { _Nlow = 0x04, _Nbytes = 1 }; @@ -118,7 +118,7 @@ namespace stdext { template class codecvt_cp1026 : public _Cvt_one_byte<_Elem, _tab_cp1026, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/cp1250 b/stl/inc/cvt/cp1250 index e16fa7e8a30..757d7214005 100644 --- a/stl/inc/cvt/cp1250 +++ b/stl/inc/cvt/cp1250 @@ -33,7 +33,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_cp1250 { enum { _Nlow = 0x80, _Nbytes = 1 }; @@ -81,7 +81,7 @@ namespace stdext { template class codecvt_cp1250 : public _Cvt_one_byte<_Elem, _tab_cp1250, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/cp1251 b/stl/inc/cvt/cp1251 index 2912810a5b3..b54ec99add3 100644 --- a/stl/inc/cvt/cp1251 +++ b/stl/inc/cvt/cp1251 @@ -33,7 +33,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_cp1251 { enum { _Nlow = 0x80, _Nbytes = 1 }; @@ -87,7 +87,7 @@ namespace stdext { template class codecvt_cp1251 : public _Cvt_one_byte<_Elem, _tab_cp1251, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/cp1252 b/stl/inc/cvt/cp1252 index 85c4f863038..fa00c9a2dad 100644 --- a/stl/inc/cvt/cp1252 +++ b/stl/inc/cvt/cp1252 @@ -33,7 +33,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_cp1252 { enum { _Nlow = 0x80, _Nbytes = 1 }; @@ -75,7 +75,7 @@ namespace stdext { template class codecvt_cp1252 : public _Cvt_one_byte<_Elem, _tab_cp1252, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/cp1253 b/stl/inc/cvt/cp1253 index 30038a6f584..083e18b7446 100644 --- a/stl/inc/cvt/cp1253 +++ b/stl/inc/cvt/cp1253 @@ -33,7 +33,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_cp1253 { enum { _Nlow = 0x80, _Nbytes = 1 }; @@ -83,7 +83,7 @@ namespace stdext { template class codecvt_cp1253 : public _Cvt_one_byte<_Elem, _tab_cp1253, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/cp1254 b/stl/inc/cvt/cp1254 index 7cf1ac99fe8..0c508442719 100644 --- a/stl/inc/cvt/cp1254 +++ b/stl/inc/cvt/cp1254 @@ -33,7 +33,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_cp1254 { enum { _Nlow = 0x80, _Nbytes = 1 }; @@ -75,7 +75,7 @@ namespace stdext { template class codecvt_cp1254 : public _Cvt_one_byte<_Elem, _tab_cp1254, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/cp1255 b/stl/inc/cvt/cp1255 index f4d7991c47c..133483f374c 100644 --- a/stl/inc/cvt/cp1255 +++ b/stl/inc/cvt/cp1255 @@ -33,7 +33,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_cp1255 { enum { _Nlow = 0x80, _Nbytes = 1 }; @@ -81,7 +81,7 @@ namespace stdext { template class codecvt_cp1255 : public _Cvt_one_byte<_Elem, _tab_cp1255, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/cp1256 b/stl/inc/cvt/cp1256 index 52c61e945d5..055a545979d 100644 --- a/stl/inc/cvt/cp1256 +++ b/stl/inc/cvt/cp1256 @@ -33,7 +33,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_cp1256 { enum { _Nlow = 0x80, _Nbytes = 1 }; @@ -83,7 +83,7 @@ namespace stdext { template class codecvt_cp1256 : public _Cvt_one_byte<_Elem, _tab_cp1256, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/cp1257 b/stl/inc/cvt/cp1257 index 47206b18738..198e5ce4086 100644 --- a/stl/inc/cvt/cp1257 +++ b/stl/inc/cvt/cp1257 @@ -33,7 +33,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_cp1257 { enum { _Nlow = 0x80, _Nbytes = 1 }; @@ -81,7 +81,7 @@ namespace stdext { template class codecvt_cp1257 : public _Cvt_one_byte<_Elem, _tab_cp1257, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/cp1258 b/stl/inc/cvt/cp1258 index 4d1051e2118..73efaa4a77b 100644 --- a/stl/inc/cvt/cp1258 +++ b/stl/inc/cvt/cp1258 @@ -33,7 +33,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_cp1258 { enum { _Nlow = 0x80, _Nbytes = 1 }; @@ -75,7 +75,7 @@ namespace stdext { template class codecvt_cp1258 : public _Cvt_one_byte<_Elem, _tab_cp1258, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/cp424 b/stl/inc/cvt/cp424 index 62727cb9d24..7c8d9c921ae 100644 --- a/stl/inc/cvt/cp424 +++ b/stl/inc/cvt/cp424 @@ -63,7 +63,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_cp424 { enum { _Nlow = 0x04, _Nbytes = 1 }; @@ -141,7 +141,7 @@ namespace stdext { template class codecvt_cp424 : public _Cvt_one_byte<_Elem, _tab_cp424, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/cp437 b/stl/inc/cvt/cp437 index d7225d842cb..4766e184d1a 100644 --- a/stl/inc/cvt/cp437 +++ b/stl/inc/cvt/cp437 @@ -34,7 +34,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_cp437 { enum { _Nlow = 0x80, _Nbytes = 1 }; @@ -90,7 +90,7 @@ namespace stdext { template class codecvt_cp437 : public _Cvt_one_byte<_Elem, _tab_cp437, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/cp500 b/stl/inc/cvt/cp500 index ba67523a438..fb383b42539 100644 --- a/stl/inc/cvt/cp500 +++ b/stl/inc/cvt/cp500 @@ -34,7 +34,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_cp500 { enum { _Nlow = 0x04, _Nbytes = 1 }; @@ -118,7 +118,7 @@ namespace stdext { template class codecvt_cp500 : public _Cvt_one_byte<_Elem, _tab_cp500, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/cp737 b/stl/inc/cvt/cp737 index 352ba15dcd4..989ef9b7b57 100644 --- a/stl/inc/cvt/cp737 +++ b/stl/inc/cvt/cp737 @@ -34,7 +34,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_cp737 { enum { _Nlow = 0x80, _Nbytes = 1 }; @@ -90,7 +90,7 @@ namespace stdext { template class codecvt_cp737 : public _Cvt_one_byte<_Elem, _tab_cp737, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/cp775 b/stl/inc/cvt/cp775 index d842408dd84..bd5c2478ec7 100644 --- a/stl/inc/cvt/cp775 +++ b/stl/inc/cvt/cp775 @@ -34,7 +34,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_cp775 { enum { _Nlow = 0x80, _Nbytes = 1 }; @@ -90,7 +90,7 @@ namespace stdext { template class codecvt_cp775 : public _Cvt_one_byte<_Elem, _tab_cp775, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/cp850 b/stl/inc/cvt/cp850 index c3a6f979279..52892dbfee3 100644 --- a/stl/inc/cvt/cp850 +++ b/stl/inc/cvt/cp850 @@ -34,7 +34,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_cp850 { enum { _Nlow = 0x80, _Nbytes = 1 }; @@ -90,7 +90,7 @@ namespace stdext { template class codecvt_cp850 : public _Cvt_one_byte<_Elem, _tab_cp850, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/cp852 b/stl/inc/cvt/cp852 index 0334e981df9..039433e7a1e 100644 --- a/stl/inc/cvt/cp852 +++ b/stl/inc/cvt/cp852 @@ -34,7 +34,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_cp852 { enum { _Nlow = 0x80, _Nbytes = 1 }; @@ -90,7 +90,7 @@ namespace stdext { template class codecvt_cp852 : public _Cvt_one_byte<_Elem, _tab_cp852, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/cp855 b/stl/inc/cvt/cp855 index 5ac282afb22..f45c7622ef9 100644 --- a/stl/inc/cvt/cp855 +++ b/stl/inc/cvt/cp855 @@ -34,7 +34,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_cp855 { enum { _Nlow = 0x80, _Nbytes = 1 }; @@ -90,7 +90,7 @@ namespace stdext { template class codecvt_cp855 : public _Cvt_one_byte<_Elem, _tab_cp855, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/cp856 b/stl/inc/cvt/cp856 index af600e895de..1466bf72f61 100644 --- a/stl/inc/cvt/cp856 +++ b/stl/inc/cvt/cp856 @@ -62,7 +62,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_cp856 { enum { _Nlow = 0x80, _Nbytes = 1 }; @@ -112,7 +112,7 @@ namespace stdext { template class codecvt_cp856 : public _Cvt_one_byte<_Elem, _tab_cp856, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/cp857 b/stl/inc/cvt/cp857 index 938e09d63f6..5043c0276ed 100644 --- a/stl/inc/cvt/cp857 +++ b/stl/inc/cvt/cp857 @@ -34,7 +34,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_cp857 { enum { _Nlow = 0x80, _Nbytes = 1 }; @@ -90,7 +90,7 @@ namespace stdext { template class codecvt_cp857 : public _Cvt_one_byte<_Elem, _tab_cp857, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/cp860 b/stl/inc/cvt/cp860 index b86395dc957..c07177beb19 100644 --- a/stl/inc/cvt/cp860 +++ b/stl/inc/cvt/cp860 @@ -34,7 +34,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_cp860 { enum { _Nlow = 0x80, _Nbytes = 1 }; @@ -90,7 +90,7 @@ namespace stdext { template class codecvt_cp860 : public _Cvt_one_byte<_Elem, _tab_cp860, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/cp861 b/stl/inc/cvt/cp861 index 5b202388819..a3f12fcd756 100644 --- a/stl/inc/cvt/cp861 +++ b/stl/inc/cvt/cp861 @@ -34,7 +34,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_cp861 { enum { _Nlow = 0x80, _Nbytes = 1 }; @@ -90,7 +90,7 @@ namespace stdext { template class codecvt_cp861 : public _Cvt_one_byte<_Elem, _tab_cp861, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/cp862 b/stl/inc/cvt/cp862 index 23c3418fb90..7e1e3347b96 100644 --- a/stl/inc/cvt/cp862 +++ b/stl/inc/cvt/cp862 @@ -34,7 +34,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_cp862 { enum { _Nlow = 0x80, _Nbytes = 1 }; @@ -90,7 +90,7 @@ namespace stdext { template class codecvt_cp862 : public _Cvt_one_byte<_Elem, _tab_cp862, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/cp863 b/stl/inc/cvt/cp863 index 69732d7dba3..3fdb5700a8b 100644 --- a/stl/inc/cvt/cp863 +++ b/stl/inc/cvt/cp863 @@ -34,7 +34,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_cp863 { enum { _Nlow = 0x80, _Nbytes = 1 }; @@ -90,7 +90,7 @@ namespace stdext { template class codecvt_cp863 : public _Cvt_one_byte<_Elem, _tab_cp863, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/cp864 b/stl/inc/cvt/cp864 index 69eac98e266..4490a6c9f09 100644 --- a/stl/inc/cvt/cp864 +++ b/stl/inc/cvt/cp864 @@ -34,7 +34,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_cp864 { enum { _Nlow = 0x25, _Nbytes = 1 }; @@ -97,7 +97,7 @@ namespace stdext { template class codecvt_cp864 : public _Cvt_one_byte<_Elem, _tab_cp864, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/cp865 b/stl/inc/cvt/cp865 index 992f5d6f2ce..e45f8364c76 100644 --- a/stl/inc/cvt/cp865 +++ b/stl/inc/cvt/cp865 @@ -34,7 +34,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_cp865 { enum { _Nlow = 0x80, _Nbytes = 1 }; @@ -90,7 +90,7 @@ namespace stdext { template class codecvt_cp865 : public _Cvt_one_byte<_Elem, _tab_cp865, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/cp866 b/stl/inc/cvt/cp866 index 4822af4b76c..c1467b480a3 100644 --- a/stl/inc/cvt/cp866 +++ b/stl/inc/cvt/cp866 @@ -34,7 +34,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_cp866 { enum { _Nlow = 0x80, _Nbytes = 1 }; @@ -90,7 +90,7 @@ namespace stdext { template class codecvt_cp866 : public _Cvt_one_byte<_Elem, _tab_cp866, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/cp869 b/stl/inc/cvt/cp869 index a87fc460b5b..233b4f3918f 100644 --- a/stl/inc/cvt/cp869 +++ b/stl/inc/cvt/cp869 @@ -34,7 +34,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_cp869 { enum { _Nlow = 0x80, _Nbytes = 1 }; @@ -90,7 +90,7 @@ namespace stdext { template class codecvt_cp869 : public _Cvt_one_byte<_Elem, _tab_cp869, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/cp874 b/stl/inc/cvt/cp874 index 362d432aa5b..9ba7f508f65 100644 --- a/stl/inc/cvt/cp874 +++ b/stl/inc/cvt/cp874 @@ -33,7 +33,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_cp874 { enum { _Nlow = 0x80, _Nbytes = 1 }; @@ -85,7 +85,7 @@ namespace stdext { template class codecvt_cp874 : public _Cvt_one_byte<_Elem, _tab_cp874, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/cp875 b/stl/inc/cvt/cp875 index fba746d3447..8a6bdb246b1 100644 --- a/stl/inc/cvt/cp875 +++ b/stl/inc/cvt/cp875 @@ -34,7 +34,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_cp875 { enum { _Nlow = 0x04, _Nbytes = 1 }; @@ -118,7 +118,7 @@ namespace stdext { template class codecvt_cp875 : public _Cvt_one_byte<_Elem, _tab_cp875, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/cp932 b/stl/inc/cvt/cp932 index 61cf2fc0e9a..c9c6f8c1817 100644 --- a/stl/inc/cvt/cp932 +++ b/stl/inc/cvt/cp932 @@ -33,7 +33,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_cp932 { enum { _Nlow = 0x80, _Nbytes = 2 }; @@ -2459,7 +2459,7 @@ namespace stdext { template class codecvt_cp932 : public _Cvt_two_byte<_Elem, _tab_cp932, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/cp936 b/stl/inc/cvt/cp936 index 21a7189490f..177e4e29bf1 100644 --- a/stl/inc/cvt/cp936 +++ b/stl/inc/cvt/cp936 @@ -33,7 +33,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_cp936 { enum { _Nlow = 0x80, _Nbytes = 2 }; @@ -6779,7 +6779,7 @@ namespace stdext { template class codecvt_cp936 : public _Cvt_two_byte<_Elem, _tab_cp936, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/cp949 b/stl/inc/cvt/cp949 index 73751dd3e7f..28686066832 100644 --- a/stl/inc/cvt/cp949 +++ b/stl/inc/cvt/cp949 @@ -33,7 +33,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_cp949 { enum { _Nlow = 0x80, _Nbytes = 2 }; @@ -5319,7 +5319,7 @@ namespace stdext { template class codecvt_cp949 : public _Cvt_two_byte<_Elem, _tab_cp949, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/cp950 b/stl/inc/cvt/cp950 index 481b8f6fcf0..af258aa4c6d 100644 --- a/stl/inc/cvt/cp950 +++ b/stl/inc/cvt/cp950 @@ -33,7 +33,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_cp950 { enum { _Nlow = 0x80, _Nbytes = 2 }; @@ -4227,7 +4227,7 @@ namespace stdext { template class codecvt_cp950 : public _Cvt_two_byte<_Elem, _tab_cp950, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/cyrillic b/stl/inc/cvt/cyrillic index f0a726e46a6..5c26b27bbdd 100644 --- a/stl/inc/cvt/cyrillic +++ b/stl/inc/cvt/cyrillic @@ -34,7 +34,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_cyrillic { enum { _Nlow = 0x80, _Nbytes = 1 }; @@ -90,7 +90,7 @@ namespace stdext { template class codecvt_cyrillic : public _Cvt_one_byte<_Elem, _tab_cyrillic, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/ebcdic b/stl/inc/cvt/ebcdic index 98108eb69d4..e29b0f3a973 100644 --- a/stl/inc/cvt/ebcdic +++ b/stl/inc/cvt/ebcdic @@ -18,7 +18,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { using _Statype = _CSTD mbstate_t; template @@ -175,7 +175,7 @@ namespace stdext { 0xdc, 0xdd, 0xde, 0xdf, 0xea, 0xeb, 0xec, 0xed, // 0xee, 0xef, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, // }; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/euc b/stl/inc/cvt/euc index 6857562d866..adb9dd60204 100644 --- a/stl/inc/cvt/euc +++ b/stl/inc/cvt/euc @@ -77,7 +77,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_euc { enum { _Nlow = 0x5c, _Nbytes = 2 }; @@ -2256,7 +2256,7 @@ namespace stdext { template class codecvt_euc : public _Cvt_two_byte<_Elem, _tab_euc, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/euc_0208 b/stl/inc/cvt/euc_0208 index 9ecbe2d6521..8ef4d12722e 100644 --- a/stl/inc/cvt/euc_0208 +++ b/stl/inc/cvt/euc_0208 @@ -18,7 +18,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { using _Statype = _CSTD mbstate_t; template @@ -186,7 +186,7 @@ namespace stdext { return 0; // 0 => varying length } }; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/gb12345 b/stl/inc/cvt/gb12345 index a3d8ef88e27..a19c58910f2 100644 --- a/stl/inc/cvt/gb12345 +++ b/stl/inc/cvt/gb12345 @@ -44,7 +44,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_gb12345 { enum { _Nlow = 0x5c, _Nbytes = 2 }; @@ -2409,7 +2409,7 @@ namespace stdext { template class codecvt_gb12345 : public _Cvt_two_byte<_Elem, _tab_gb12345, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/gb2312 b/stl/inc/cvt/gb2312 index 0487a86312a..fa797bf6284 100644 --- a/stl/inc/cvt/gb2312 +++ b/stl/inc/cvt/gb2312 @@ -87,7 +87,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_gb2312 { enum { _Nlow = 0x5c, _Nbytes = 2 }; @@ -2420,7 +2420,7 @@ namespace stdext { template class codecvt_gb2312 : public _Cvt_two_byte<_Elem, _tab_gb2312, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/greek b/stl/inc/cvt/greek index d698b013304..34dae7b05a4 100644 --- a/stl/inc/cvt/greek +++ b/stl/inc/cvt/greek @@ -34,7 +34,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_greek { enum { _Nlow = 0x80, _Nbytes = 1 }; @@ -90,7 +90,7 @@ namespace stdext { template class codecvt_greek : public _Cvt_one_byte<_Elem, _tab_greek, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/iceland b/stl/inc/cvt/iceland index 93a4400da79..955ffa8c808 100644 --- a/stl/inc/cvt/iceland +++ b/stl/inc/cvt/iceland @@ -34,7 +34,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_iceland { enum { _Nlow = 0x80, _Nbytes = 1 }; @@ -90,7 +90,7 @@ namespace stdext { template class codecvt_iceland : public _Cvt_one_byte<_Elem, _tab_iceland, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/jis b/stl/inc/cvt/jis index d946dcff072..6ef1230d727 100644 --- a/stl/inc/cvt/jis +++ b/stl/inc/cvt/jis @@ -77,7 +77,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_jis { enum { _Nlow = 0x5c, _Nbytes = 2 }; @@ -2246,7 +2246,7 @@ namespace stdext { 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7, 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x00df, 0x2131, 0x216f}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #include diff --git a/stl/inc/cvt/jis0201 b/stl/inc/cvt/jis0201 index d13cf1eefb7..b8e3bdbfbeb 100644 --- a/stl/inc/cvt/jis0201 +++ b/stl/inc/cvt/jis0201 @@ -77,7 +77,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_jis0201 { enum { _Nlow = 0x5c, _Nbytes = 1 }; @@ -126,7 +126,7 @@ namespace stdext { template class codecvt_jis0201 : public _Cvt_one_byte<_Elem, _tab_jis0201, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/jis_0208 b/stl/inc/cvt/jis_0208 index 28b338536da..40a8e14cb5b 100644 --- a/stl/inc/cvt/jis_0208 +++ b/stl/inc/cvt/jis_0208 @@ -18,7 +18,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { using _Statype = _CSTD mbstate_t; #define _ESC_CODE 0x1b @@ -243,7 +243,7 @@ namespace stdext { return 0; // 0 => varying length } }; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/ksc5601 b/stl/inc/cvt/ksc5601 index c8d9e560a62..241ba63e3f9 100644 --- a/stl/inc/cvt/ksc5601 +++ b/stl/inc/cvt/ksc5601 @@ -47,7 +47,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_ksc5601 { enum { _Nlow = 0x80, _Nbytes = 2 }; @@ -5333,7 +5333,7 @@ namespace stdext { template class codecvt_ksc5601 : public _Cvt_two_byte<_Elem, _tab_ksc5601, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/latin2 b/stl/inc/cvt/latin2 index fe0f99f1cd5..8f7e91a8f53 100644 --- a/stl/inc/cvt/latin2 +++ b/stl/inc/cvt/latin2 @@ -34,7 +34,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_latin2 { enum { _Nlow = 0x80, _Nbytes = 1 }; @@ -90,7 +90,7 @@ namespace stdext { template class codecvt_latin2 : public _Cvt_one_byte<_Elem, _tab_latin2, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/one_one b/stl/inc/cvt/one_one index 3869df909e0..287b65e3ab3 100644 --- a/stl/inc/cvt/one_one +++ b/stl/inc/cvt/one_one @@ -19,7 +19,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { using _Statype = _CSTD mbstate_t; @@ -225,7 +225,7 @@ namespace stdext { } }; _STL_RESTORE_DEPRECATED_WARNING - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/roman b/stl/inc/cvt/roman index b2e0efe29dd..27004cf35a5 100644 --- a/stl/inc/cvt/roman +++ b/stl/inc/cvt/roman @@ -34,7 +34,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_roman { enum { _Nlow = 0x80, _Nbytes = 1 }; @@ -90,7 +90,7 @@ namespace stdext { template class codecvt_roman : public _Cvt_one_byte<_Elem, _tab_roman, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/sjis b/stl/inc/cvt/sjis index 2d94acf997f..19e125ff2dd 100644 --- a/stl/inc/cvt/sjis +++ b/stl/inc/cvt/sjis @@ -77,7 +77,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_sjis { enum { _Nlow = 0x5c, _Nbytes = 2 }; @@ -2248,7 +2248,7 @@ namespace stdext { template class codecvt_sjis : public _Cvt_two_byte<_Elem, _tab_sjis, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/sjis_0208 b/stl/inc/cvt/sjis_0208 index 64115176e7d..521f44aa0d3 100644 --- a/stl/inc/cvt/sjis_0208 +++ b/stl/inc/cvt/sjis_0208 @@ -18,7 +18,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { using _Statype = _CSTD mbstate_t; @@ -174,7 +174,7 @@ namespace stdext { return 0; // 0 => varying length } }; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/turkish b/stl/inc/cvt/turkish index e59857b6810..bbf61316f8c 100644 --- a/stl/inc/cvt/turkish +++ b/stl/inc/cvt/turkish @@ -34,7 +34,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template struct _tab_turkish { enum { _Nlow = 0x80, _Nbytes = 1 }; @@ -90,7 +90,7 @@ namespace stdext { template class codecvt_turkish : public _Cvt_one_byte<_Elem, _tab_turkish, _Maxcode> {}; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/utf16 b/stl/inc/cvt/utf16 index 64d65307c72..c97f6ce47df 100644 --- a/stl/inc/cvt/utf16 +++ b/stl/inc/cvt/utf16 @@ -19,7 +19,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { using _Statype = _CSTD mbstate_t; _STL_DISABLE_DEPRECATED_WARNING @@ -254,7 +254,7 @@ namespace stdext { } }; _STL_RESTORE_DEPRECATED_WARNING - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/utf8 b/stl/inc/cvt/utf8 index 4e8e0befd62..81a4c3393e7 100644 --- a/stl/inc/cvt/utf8 +++ b/stl/inc/cvt/utf8 @@ -19,7 +19,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { using _Statype = _CSTD mbstate_t; @@ -233,7 +233,7 @@ namespace stdext { } }; _STL_RESTORE_DEPRECATED_WARNING - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/utf8_utf16 b/stl/inc/cvt/utf8_utf16 index 2c5593f988d..745eee4204f 100644 --- a/stl/inc/cvt/utf8_utf16 +++ b/stl/inc/cvt/utf8_utf16 @@ -19,7 +19,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { using _Mbstatype = _CSTD mbstate_t; @@ -289,7 +289,7 @@ namespace stdext { } }; _STL_RESTORE_DEPRECATED_WARNING - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/wbuffer b/stl/inc/cvt/wbuffer index 90b3302b087..a3d8f1c9a7a 100644 --- a/stl/inc/cvt/wbuffer +++ b/stl/inc/cvt/wbuffer @@ -23,7 +23,7 @@ _STL_DISABLE_CLANG_WARNINGS // mywcout << static_cast(0x80); // writes 0xc2 0x80 namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template > class wbuffer_convert @@ -314,7 +314,7 @@ namespace stdext { _STD string _Str; // unconsumed input bytes _STD locale _Loc; // manages reference to codecvt facet }; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") _STL_RESTORE_CLANG_WARNINGS diff --git a/stl/inc/cvt/wstring b/stl/inc/cvt/wstring index 80a3078dba0..a481a8adb61 100644 --- a/stl/inc/cvt/wstring +++ b/stl/inc/cvt/wstring @@ -20,7 +20,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { template class wstring_convert { // converts between _Elem (wide) and char (byte) strings @@ -217,7 +217,7 @@ namespace stdext { bool _Has_werr; size_t _Nconv; }; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") _STL_RESTORE_CLANG_WARNINGS diff --git a/stl/inc/cvt/xjis b/stl/inc/cvt/xjis index 047e724d89d..5d246dfd6da 100644 --- a/stl/inc/cvt/xjis +++ b/stl/inc/cvt/xjis @@ -22,7 +22,7 @@ _STL_DISABLE_CLANG_WARNINGS #endif // _CVT_JIS_ namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { using _Statype = _CSTD mbstate_t; @@ -306,7 +306,7 @@ namespace stdext { return 0; // 0 => varying length } }; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/xone_byte b/stl/inc/cvt/xone_byte index 7bc94360117..dae7499ed1e 100644 --- a/stl/inc/cvt/xone_byte +++ b/stl/inc/cvt/xone_byte @@ -18,7 +18,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { using _Statype = _CSTD mbstate_t; @@ -125,7 +125,7 @@ namespace stdext { return 1; // >0 => fixed sequence length } }; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/cvt/xtwo_byte b/stl/inc/cvt/xtwo_byte index 46cc686728d..897aadf516d 100644 --- a/stl/inc/cvt/xtwo_byte +++ b/stl/inc/cvt/xtwo_byte @@ -18,7 +18,7 @@ _STL_DISABLE_CLANG_WARNINGS #undef new namespace stdext { - namespace cvt { + namespace _DEPRECATE_STDEXT_CVT cvt { using _Statype = _CSTD mbstate_t; @@ -192,7 +192,7 @@ namespace stdext { return 0; // 0 => varying length } }; - } // namespace cvt + } // namespace _DEPRECATE_STDEXT_CVT cvt } // namespace stdext #pragma pop_macro("new") diff --git a/stl/inc/yvals_core.h b/stl/inc/yvals_core.h index 8c4555384e5..aea4cc51f76 100644 --- a/stl/inc/yvals_core.h +++ b/stl/inc/yvals_core.h @@ -1480,18 +1480,29 @@ _EMIT_STL_ERROR(STL1004, "C++98 unexpected() is incompatible with C++23 unexpect #endif // ^^^ warning disabled ^^^ #if _HAS_CXX17 && !defined(_SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING) \ - && !defined(_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS) + && !defined(_SILENCE_ALL_MS_EXT_DEPRECATION_WARNINGS) #define _DEPRECATE_STDEXT_ARR_ITERS \ [[deprecated( \ "warning STL4043: stdext::checked_array_iterator, stdext::unchecked_array_iterator, and related factory " \ - "functions are non-Standard extensions and will be removed in the future. std::span (since C++20) " \ - "and gsl::span can be used instead. You can define _SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING or " \ - "_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to suppress this warning.")]] + "functions are non-Standard extensions and will be removed in the future. std::span (since C++20) and " \ + "gsl::span can be used instead. You can define _SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING or " \ + "_SILENCE_ALL_MS_EXT_DEPRECATION_WARNINGS to suppress this warning.")]] #else // ^^^ warning enabled / warning disabled vvv #define _DEPRECATE_STDEXT_ARR_ITERS #endif // ^^^ warning disabled ^^^ -// next warning number: STL4044 +#if _HAS_CXX17 && !defined(_SILENCE_STDEXT_CVT_DEPRECATION_WARNING) \ + && !defined(_SILENCE_ALL_MS_EXT_DEPRECATION_WARNINGS) +#define _DEPRECATE_STDEXT_CVT \ + [[deprecated("warning STL4044: The contents of the stdext::cvt namespace are non-Standard extensions and will be " \ + "removed in the future. The MultiByteToWideChar() and WideCharToMultiByte() functions can be used " \ + "instead. You can define _SILENCE_STDEXT_CVT_DEPRECATION_WARNING or " \ + "_SILENCE_ALL_MS_EXT_DEPRECATION_WARNINGS to suppress this warning.")]] +#else // ^^^ warning enabled / warning disabled vvv +#define _DEPRECATE_STDEXT_CVT +#endif // ^^^ warning disabled ^^^ + +// next warning number: STL4045 // next error number: STL1006 diff --git a/tests/std/tests/Dev11_0453373_codecvt_compiles/test.compile.pass.cpp b/tests/std/tests/Dev11_0453373_codecvt_compiles/test.compile.pass.cpp index a619377cf5b..4b17ef8544b 100644 --- a/tests/std/tests/Dev11_0453373_codecvt_compiles/test.compile.pass.cpp +++ b/tests/std/tests/Dev11_0453373_codecvt_compiles/test.compile.pass.cpp @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #define _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING +#define _SILENCE_STDEXT_CVT_DEPRECATION_WARNING #include #include diff --git a/tests/std/tests/P0218R1_filesystem/test.cpp b/tests/std/tests/P0218R1_filesystem/test.cpp index 9dccd939413..0c9da8b2b45 100644 --- a/tests/std/tests/P0218R1_filesystem/test.cpp +++ b/tests/std/tests/P0218R1_filesystem/test.cpp @@ -2,6 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #define _SILENCE_CXX20_U8PATH_DEPRECATION_WARNING +#define _SILENCE_STDEXT_CVT_DEPRECATION_WARNING + #include #include #include diff --git a/tests/std/tests/VSO_0000000_instantiate_cvt/test.compile.pass.cpp b/tests/std/tests/VSO_0000000_instantiate_cvt/test.compile.pass.cpp index e2502be67e3..e5e9231c37f 100644 --- a/tests/std/tests/VSO_0000000_instantiate_cvt/test.compile.pass.cpp +++ b/tests/std/tests/VSO_0000000_instantiate_cvt/test.compile.pass.cpp @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +#define _SILENCE_STDEXT_CVT_DEPRECATION_WARNING #define _USE_NAMED_IDL_NAMESPACE 1 #ifndef _M_CEE_PURE // chk builds of /clr:pure compile this test extremely slowly. diff --git a/tests/tr1/tests/cvt/env.lst b/tests/tr1/tests/cvt/env.lst index 05d39111052..815c53e70ba 100644 --- a/tests/tr1/tests/cvt/env.lst +++ b/tests/tr1/tests/cvt/env.lst @@ -2,3 +2,5 @@ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception RUNALL_INCLUDE ..\..\env_single.lst +RUNALL_CROSSLIST +PM_CL="/D_SILENCE_STDEXT_CVT_DEPRECATION_WARNING" From b091f2a97247c0ccbc3bbc55c5a53f9ce50f024e Mon Sep 17 00:00:00 2001 From: Alex Guteniev Date: Thu, 31 Aug 2023 19:20:14 +0300 Subject: [PATCH 08/21] Avoid calling `size()` in valarray loops (#3968) ... to ease auto-vectorization. --------- Co-authored-by: Stephan T. Lavavej Co-authored-by: Casey Carter --- stl/inc/valarray | 77 +++++++++++++++++++++++------------------------- 1 file changed, 37 insertions(+), 40 deletions(-) diff --git a/stl/inc/valarray b/stl/inc/valarray index cb360998f34..e62943f2fe0 100644 --- a/stl/inc/valarray +++ b/stl/inc/valarray @@ -166,7 +166,7 @@ public: } valarray& operator=(const _Ty& _Val) { - const size_t _Size = size(); + const size_t _Size = _Mysize; // eliminating indirection helps vectorization for (size_t _Idx = 0; _Idx < _Size; ++_Idx) { _Myptr[_Idx] = _Val; } @@ -192,7 +192,7 @@ public: valarray& operator=(const indirect_array<_Ty>& _Indarr); // defined below _NODISCARD valarray operator+() const { - const size_t _Size = size(); + const size_t _Size = _Mysize; // eliminating indirection helps vectorization valarray<_Ty> _Ans(_Size); for (size_t _Idx = 0; _Idx < _Size; ++_Idx) { _Ans[_Idx] = +_Myptr[_Idx]; @@ -201,7 +201,7 @@ public: } _NODISCARD valarray operator-() const { - const size_t _Size = size(); + const size_t _Size = _Mysize; // eliminating indirection helps vectorization valarray<_Ty> _Ans(_Size); for (size_t _Idx = 0; _Idx < _Size; ++_Idx) { _Ans[_Idx] = -_Myptr[_Idx]; @@ -210,7 +210,7 @@ public: } _NODISCARD valarray operator~() const { - const size_t _Size = size(); + const size_t _Size = _Mysize; // eliminating indirection helps vectorization valarray<_Ty> _Ans(_Size); for (size_t _Idx = 0; _Idx < _Size; ++_Idx) { _Ans[_Idx] = ~_Myptr[_Idx]; @@ -219,7 +219,7 @@ public: } _NODISCARD _Boolarray operator!() const { - const size_t _Size = size(); + const size_t _Size = _Mysize; // eliminating indirection helps vectorization valarray _Ans(_Size); for (size_t _Idx = 0; _Idx < _Size; ++_Idx) { _Ans[_Idx] = !_Myptr[_Idx]; @@ -228,7 +228,7 @@ public: } valarray& operator*=(const _Ty& _Right) { - const size_t _Size = size(); + const size_t _Size = _Mysize; // eliminating indirection helps vectorization for (size_t _Idx = 0; _Idx < _Size; ++_Idx) { _Myptr[_Idx] *= _Right; } @@ -236,7 +236,7 @@ public: } valarray& operator/=(const _Ty& _Right) { - const size_t _Size = size(); + const size_t _Size = _Mysize; // eliminating indirection helps vectorization for (size_t _Idx = 0; _Idx < _Size; ++_Idx) { _Myptr[_Idx] /= _Right; } @@ -244,7 +244,7 @@ public: } valarray& operator%=(const _Ty& _Right) { - const size_t _Size = size(); + const size_t _Size = _Mysize; // eliminating indirection helps vectorization for (size_t _Idx = 0; _Idx < _Size; ++_Idx) { _Myptr[_Idx] %= _Right; } @@ -252,7 +252,7 @@ public: } valarray& operator+=(const _Ty& _Right) { - const size_t _Size = size(); + const size_t _Size = _Mysize; // eliminating indirection helps vectorization for (size_t _Idx = 0; _Idx < _Size; ++_Idx) { _Myptr[_Idx] += _Right; } @@ -260,7 +260,7 @@ public: } valarray& operator-=(const _Ty& _Right) { - const size_t _Size = size(); + const size_t _Size = _Mysize; // eliminating indirection helps vectorization for (size_t _Idx = 0; _Idx < _Size; ++_Idx) { _Myptr[_Idx] -= _Right; } @@ -268,7 +268,7 @@ public: } valarray& operator^=(const _Ty& _Right) { - const size_t _Size = size(); + const size_t _Size = _Mysize; // eliminating indirection helps vectorization for (size_t _Idx = 0; _Idx < _Size; ++_Idx) { _Myptr[_Idx] ^= _Right; } @@ -276,7 +276,7 @@ public: } valarray& operator&=(const _Ty& _Right) { - const size_t _Size = size(); + const size_t _Size = _Mysize; // eliminating indirection helps vectorization for (size_t _Idx = 0; _Idx < _Size; ++_Idx) { _Myptr[_Idx] &= _Right; } @@ -284,7 +284,7 @@ public: } valarray& operator|=(const _Ty& _Right) { - const size_t _Size = size(); + const size_t _Size = _Mysize; // eliminating indirection helps vectorization for (size_t _Idx = 0; _Idx < _Size; ++_Idx) { _Myptr[_Idx] |= _Right; } @@ -292,7 +292,7 @@ public: } valarray& operator<<=(const _Ty& _Right) { - const size_t _Size = size(); + const size_t _Size = _Mysize; // eliminating indirection helps vectorization for (size_t _Idx = 0; _Idx < _Size; ++_Idx) { _Myptr[_Idx] <<= _Right; } @@ -300,7 +300,7 @@ public: } valarray& operator>>=(const _Ty& _Right) { - const size_t _Size = size(); + const size_t _Size = _Mysize; // eliminating indirection helps vectorization for (size_t _Idx = 0; _Idx < _Size; ++_Idx) { _Myptr[_Idx] >>= _Right; } @@ -308,7 +308,7 @@ public: } valarray& operator*=(const valarray& _Right) { - const size_t _Size = size(); + const size_t _Size = _Mysize; // eliminating indirection helps vectorization for (size_t _Idx = 0; _Idx < _Size; ++_Idx) { _Myptr[_Idx] *= _Right[_Idx]; } @@ -316,7 +316,7 @@ public: } valarray& operator/=(const valarray& _Right) { - const size_t _Size = size(); + const size_t _Size = _Mysize; // eliminating indirection helps vectorization for (size_t _Idx = 0; _Idx < _Size; ++_Idx) { _Myptr[_Idx] /= _Right[_Idx]; } @@ -324,7 +324,7 @@ public: } valarray& operator%=(const valarray& _Right) { - const size_t _Size = size(); + const size_t _Size = _Mysize; // eliminating indirection helps vectorization for (size_t _Idx = 0; _Idx < _Size; ++_Idx) { _Myptr[_Idx] %= _Right[_Idx]; } @@ -332,7 +332,7 @@ public: } valarray& operator+=(const valarray& _Right) { - const size_t _Size = size(); + const size_t _Size = _Mysize; // eliminating indirection helps vectorization for (size_t _Idx = 0; _Idx < _Size; ++_Idx) { _Myptr[_Idx] += _Right[_Idx]; } @@ -340,7 +340,7 @@ public: } valarray& operator-=(const valarray& _Right) { - const size_t _Size = size(); + const size_t _Size = _Mysize; // eliminating indirection helps vectorization for (size_t _Idx = 0; _Idx < _Size; ++_Idx) { _Myptr[_Idx] -= _Right[_Idx]; } @@ -348,7 +348,7 @@ public: } valarray& operator^=(const valarray& _Right) { - const size_t _Size = size(); + const size_t _Size = _Mysize; // eliminating indirection helps vectorization for (size_t _Idx = 0; _Idx < _Size; ++_Idx) { _Myptr[_Idx] ^= _Right[_Idx]; } @@ -356,7 +356,7 @@ public: } valarray& operator|=(const valarray& _Right) { - const size_t _Size = size(); + const size_t _Size = _Mysize; // eliminating indirection helps vectorization for (size_t _Idx = 0; _Idx < _Size; ++_Idx) { _Myptr[_Idx] |= _Right[_Idx]; } @@ -364,7 +364,7 @@ public: } valarray& operator&=(const valarray& _Right) { - const size_t _Size = size(); + const size_t _Size = _Mysize; // eliminating indirection helps vectorization for (size_t _Idx = 0; _Idx < _Size; ++_Idx) { _Myptr[_Idx] &= _Right[_Idx]; } @@ -372,7 +372,7 @@ public: } valarray& operator<<=(const valarray& _Right) { - const size_t _Size = size(); + const size_t _Size = _Mysize; // eliminating indirection helps vectorization for (size_t _Idx = 0; _Idx < _Size; ++_Idx) { _Myptr[_Idx] <<= _Right[_Idx]; } @@ -380,7 +380,7 @@ public: } valarray& operator>>=(const valarray& _Right) { - const size_t _Size = size(); + const size_t _Size = _Mysize; // eliminating indirection helps vectorization for (size_t _Idx = 0; _Idx < _Size; ++_Idx) { _Myptr[_Idx] >>= _Right[_Idx]; } @@ -424,7 +424,7 @@ public: _NODISCARD indirect_array<_Ty> operator[](const _Sizarray& _Indarr); // defined below _NODISCARD _Ty sum() const { - const size_t _Size = size(); + const size_t _Size = _Mysize; // eliminating indirection helps vectorization _Ty _Sum = _Myptr[0]; for (size_t _Idx = 1; _Idx < _Size; ++_Idx) { _Sum += _Myptr[_Idx]; @@ -434,7 +434,7 @@ public: } _NODISCARD _Ty(min)() const { - const size_t _Size = size(); + const size_t _Size = _Mysize; // eliminating indirection helps vectorization _Ty _Min = _Myptr[0]; for (size_t _Idx = 1; _Idx < _Size; ++_Idx) { if (_Myptr[_Idx] < _Min) { @@ -446,7 +446,7 @@ public: } _NODISCARD _Ty(max)() const { - const size_t _Size = size(); + const size_t _Size = _Mysize; // eliminating indirection helps vectorization _Ty _Max = _Myptr[0]; for (size_t _Idx = 1; _Idx < _Size; ++_Idx) { if (_Max < _Myptr[_Idx]) { @@ -458,7 +458,7 @@ public: } _NODISCARD valarray shift(int _Count) const { - const size_t _Size = size(); + const size_t _Size = _Mysize; // eliminating indirection helps vectorization valarray<_Ty> _Ans(_Size); size_t _Min = 0; size_t _Max = _Size; @@ -480,7 +480,7 @@ public: } _NODISCARD valarray cshift(int _Count) const { - const size_t _Size = size(); + const size_t _Size = _Mysize; // eliminating indirection helps vectorization if (_Size != 0) { if (_Count < 0) { // right shift if (_Size < size_t{0} - _Count) { @@ -502,7 +502,7 @@ public: } _NODISCARD valarray apply(_Ty _Func(_Ty)) const { - const size_t _Size = size(); + const size_t _Size = _Mysize; // eliminating indirection helps vectorization valarray<_Ty> _Ans(_Size); for (size_t _Idx = 0; _Idx < _Size; ++_Idx) { _Ans[_Idx] = _Func(_Myptr[_Idx]); @@ -512,7 +512,7 @@ public: _NODISCARD valarray apply(_Ty _Func(const _Ty&)) const { // return valarray transformed by _Func, nonmutable argument - const size_t _Size = size(); + const size_t _Size = _Mysize; // eliminating indirection helps vectorization valarray<_Ty> _Ans(_Size); for (size_t _Idx = 0; _Idx < _Size; ++_Idx) { _Ans[_Idx] = _Func(_Myptr[_Idx]); @@ -555,10 +555,7 @@ private: void _Tidy_deallocate() noexcept { if (_Myptr) { // destroy elements - for (size_t _Idx = 0; _Idx < _Mysize; ++_Idx) { - _Destroy_in_place(_Myptr[_Idx]); - } - + _Destroy_range(_Myptr, _Myptr + _Mysize); #ifdef __cpp_aligned_new constexpr bool _Extended_alignment = alignof(_Ty) > __STDCPP_DEFAULT_NEW_ALIGNMENT__; if constexpr (_Extended_alignment) { @@ -574,7 +571,7 @@ private: } void _Assign(size_t _Newsize, const _Ty* _Ptr) { - const size_t _Size = size(); + const size_t _Size = _Mysize; // eliminating indirection helps vectorization if (_Size == _Newsize) { for (size_t _Idx = 0; _Idx < _Size; ++_Idx) { _Myptr[_Idx] = _Ptr[_Idx]; @@ -1988,7 +1985,7 @@ valarray<_Ty>& valarray<_Ty>::operator=(const gslice_array<_Ty>& _Gslicearr) { _Tidy_deallocate(); _Grow(_Gslicearr._Totlen()); _Sizarray _Indexarray(size_t{0}, _Gslicearr._Nslice()); - const size_t _Size = size(); + const size_t _Size = _Mysize; // eliminating indirection helps vectorization for (size_t _Idx = 0; _Idx < _Size; ++_Idx) { _Myptr[_Idx] = _Gslicearr._Data(_Gslicearr._Off(_Indexarray)); } @@ -2011,7 +2008,7 @@ valarray<_Ty>& valarray<_Ty>::operator=(const mask_array<_Ty>& _Maskarr) { _Grow(_Maskarr._Totlen()); size_t _Count = 0; - const size_t _Size = size(); + const size_t _Size = _Mysize; // eliminating indirection helps vectorization for (size_t _Idx = 0; _Idx < _Size; ++_Count) { if (_Maskarr._Mask(_Count)) { _Myptr[_Idx++] = _Maskarr._Data(_Count); @@ -2035,7 +2032,7 @@ template valarray<_Ty>& valarray<_Ty>::operator=(const indirect_array<_Ty>& _Indarr) { _Tidy_deallocate(); _Grow(_Indarr._Totlen()); - const size_t _Size = size(); + const size_t _Size = _Mysize; // eliminating indirection helps vectorization for (size_t _Idx = 0; _Idx < _Size; ++_Idx) { _Myptr[_Idx] = _Indarr._Data(_Indarr._Indir(_Idx)); } From bbb673950b5c490be15a837d2318b25a2a35af1d Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Fri, 1 Sep 2023 00:26:26 +0800 Subject: [PATCH 09/21] Partially remove workaround for DevCom-1559808 (#3975) Remove workarounds for DevCom-1559808, relabeling some as now working around DevCom-10452846. --- stl/inc/algorithm | 4 ++-- stl/inc/ranges | 12 ------------ tests/libcxx/expected_results.txt | 4 ---- 3 files changed, 2 insertions(+), 18 deletions(-) diff --git a/stl/inc/algorithm b/stl/inc/algorithm index 29579e712ad..5c4d8b8f01c 100644 --- a/stl/inc/algorithm +++ b/stl/inc/algorithm @@ -8288,13 +8288,13 @@ namespace ranges { } // divide and conquer by quicksort -#if defined(__clang__) || defined(__EDG__) // TRANSITION, DevCom-1559808 +#if defined(__clang__) || defined(__EDG__) // TRANSITION, DevCom-10452846 auto [_Mid_first, _Mid_last] = _Partition_by_median_guess_common(_First, _Last, _Pred, _Proj); #else // ^^^ no workaround / workaround vvv auto _Mid = _Partition_by_median_guess_common(_First, _Last, _Pred, _Proj); auto _Mid_first = _Mid.begin(); auto _Mid_last = _Mid.end(); -#endif // TRANSITION, DevCom-1559808 +#endif // TRANSITION, DevCom-10452846 _Ideal = (_Ideal >> 1) + (_Ideal >> 2); // allow 1.5 log2(N) divisions diff --git a/stl/inc/ranges b/stl/inc/ranges index cca384b1fdf..c19ab8e0e0d 100644 --- a/stl/inc/ranges +++ b/stl/inc/ranges @@ -5102,13 +5102,7 @@ namespace ranges { return *this; } -#if defined(__clang__) || defined(__EDG__) // TRANSITION, DevCom-1559808 auto [_Begin, _End] = _RANGES search(subrange{_Current, _Last}, _Parent->_Pattern); -#else // ^^^ no workaround / workaround vvv - auto _Match = _RANGES search(subrange{_Current, _Last}, _Parent->_Pattern); - auto _Begin = _Match.begin(); - auto _End = _Match.end(); -#endif // TRANSITION, DevCom-1559808 if (_Begin != _Last && _RANGES empty(_Parent->_Pattern)) { ++_Begin; ++_End; @@ -5154,13 +5148,7 @@ namespace ranges { constexpr subrange> _Find_next(iterator_t<_Vw> _It) { const auto _Last = _RANGES end(_Range); -#if defined(__clang__) || defined(__EDG__) // TRANSITION, DevCom-1559808 auto [_Begin, _End] = _RANGES search(subrange{_It, _Last}, _Pattern); -#else // ^^^ no workaround / workaround vvv - auto _Match = _RANGES search(subrange{_It, _Last}, _Pattern); - auto _Begin = _Match.begin(); - auto _End = _Match.end(); -#endif // TRANSITION, DevCom-1559808 if (_Begin != _Last && _RANGES empty(_Pattern)) { ++_Begin; ++_End; diff --git a/tests/libcxx/expected_results.txt b/tests/libcxx/expected_results.txt index 6ddef1217ad..5efce3bf46a 100644 --- a/tests/libcxx/expected_results.txt +++ b/tests/libcxx/expected_results.txt @@ -381,10 +381,6 @@ std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp:0 FAIL std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort.pass.cpp:0 FAIL std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort_comp.pass.cpp:0 FAIL -# DevCom-1559808: (structured bindings for `subrange` in a constant expression) -# Skipped as this sometimes emits "fatal error C1001: Internal compiler error." with a crash dialog. -std/ranges/range.utility/range.subrange/structured_bindings.pass.cpp:0 SKIPPED - # DevCom-1436243 constexpr new initialized array std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.modifiers/reset_self.pass.cpp:0 FAIL std/utilities/smartptr/unique.ptr/unique.ptr.create/make_unique.array.pass.cpp:0 FAIL From ab600751924207014ab02f7422ee00a6843e2f0f Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Thu, 31 Aug 2023 09:29:32 -0700 Subject: [PATCH 10/21] C++20 Standard Library Modules! (#3977) After discussion and buy-in from other Standard Library maintainers, we've decided to support the named modules (`std` and `std.compat`) from C++23 in C++20 mode. --- stl/inc/ctime | 2 +- stl/inc/yvals_core.h | 28 ++++++++++--------- stl/modules/std.ixx | 10 +++++++ .../include/test_header_units_and_modules.hpp | 20 +++++++++++++ .../env.lst | 3 +- .../test.cpp | 10 +++++++ .../P2465R3_standard_library_modules/env.lst | 3 +- .../test.compile.pass.cpp | 2 +- 8 files changed, 61 insertions(+), 17 deletions(-) diff --git a/stl/inc/ctime b/stl/inc/ctime index 584900aec68..905b090e47a 100644 --- a/stl/inc/ctime +++ b/stl/inc/ctime @@ -29,7 +29,7 @@ _EXPORT_STD using _CSTD strftime; _EXPORT_STD using _CSTD timespec; #endif // _HAS_CXX17 -#if _HAS_CXX23 && defined(_BUILD_STD_MODULE) // TRANSITION, OS-33790456 +#ifdef _BUILD_STD_MODULE // TRANSITION, OS-33790456 _STL_DISABLE_DEPRECATED_WARNING _EXPORT_STD diff --git a/stl/inc/yvals_core.h b/stl/inc/yvals_core.h index aea4cc51f76..09d2cc7eaa9 100644 --- a/stl/inc/yvals_core.h +++ b/stl/inc/yvals_core.h @@ -292,6 +292,7 @@ // P2418R2 Add Support For std::generator-like Types To std::format // P2419R2 Clarify Handling Of Encodings In Localized Formatting Of chrono Types // P2432R1 Fix istream_view +// P2465R3 Standard Library Modules std And std.compat // P2508R1 basic_format_string, format_string, wformat_string // P2520R0 move_iterator Should Be A Random-Access Iterator // P2538R1 ADL-Proof projected @@ -365,7 +366,6 @@ // P2443R1 views::chunk_by // P2445R1 forward_like() // P2446R2 views::as_rvalue -// P2465R3 Standard Library Modules std And std.compat // P2467R1 ios_base::noreplace: Exclusive Mode For fstreams // P2474R2 views::repeat // P2494R2 Relaxing Range Adaptors To Allow Move-Only Types @@ -928,11 +928,14 @@ _EMIT_STL_ERROR(STL1001, "Unexpected compiler version, expected MSVC 19.36 or ne #endif // ^^^ inline (not constexpr) in C++20 and earlier ^^^ // P2465R3 Standard Library Modules std And std.compat -#if _HAS_CXX23 && defined(_BUILD_STD_MODULE) +#ifdef _BUILD_STD_MODULE +#if !_HAS_CXX20 +#error The Standard Library Modules are available only with C++20 or later. +#endif // ^^^ !_HAS_CXX20 ^^^ #define _EXPORT_STD export -#else // _HAS_CXX23 && defined(_BUILD_STD_MODULE) +#else // ^^^ defined(_BUILD_STD_MODULE) / !defined(_BUILD_STD_MODULE) vvv #define _EXPORT_STD -#endif // _HAS_CXX23 && defined(_BUILD_STD_MODULE) +#endif // ^^^ !defined(_BUILD_STD_MODULE) ^^^ // P0607R0 Inline Variables For The STL #if _HAS_CXX17 @@ -1752,6 +1755,10 @@ _EMIT_STL_ERROR(STL1004, "C++98 unexpected() is incompatible with C++23 unexpect #define __cpp_lib_list_remove_return_type 201806L #define __cpp_lib_math_constants 201907L +#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, Clang and EDG support for modules +#define __cpp_lib_modules 202207L +#endif // !defined(__clang__) && !defined(__EDG__) + #ifdef __cpp_lib_concepts #define __cpp_lib_move_iterator_concept 202207L #endif // defined(__cpp_lib_concepts) @@ -1793,15 +1800,10 @@ _EMIT_STL_ERROR(STL1004, "C++98 unexpected() is incompatible with C++23 unexpect #define __cpp_lib_formatters 202302L #endif // defined(__cpp_lib_concepts) -#define __cpp_lib_forward_like 202207L -#define __cpp_lib_invoke_r 202106L -#define __cpp_lib_ios_noreplace 202207L -#define __cpp_lib_is_scoped_enum 202011L - -#if !defined(__clang__) && !defined(__EDG__) // TRANSITION, Clang and EDG support for modules -#define __cpp_lib_modules 202207L -#endif // !defined(__clang__) && !defined(__EDG__) - +#define __cpp_lib_forward_like 202207L +#define __cpp_lib_invoke_r 202106L +#define __cpp_lib_ios_noreplace 202207L +#define __cpp_lib_is_scoped_enum 202011L #define __cpp_lib_move_only_function 202110L #ifdef __cpp_lib_concepts diff --git a/stl/modules/std.ixx b/stl/modules/std.ixx index 326d944d74f..fed223a5fcd 100644 --- a/stl/modules/std.ixx +++ b/stl/modules/std.ixx @@ -57,7 +57,9 @@ export module std; #include #include #include +#if _HAS_CXX23 #include +#endif // _HAS_CXX23 #include #include #include @@ -84,7 +86,9 @@ export module std; #include #include #include +#if _HAS_CXX23 #include +#endif // _HAS_CXX23 #include #include #include @@ -96,12 +100,18 @@ export module std; #include #include #include +#if _HAS_CXX23 #include +#endif // _HAS_CXX23 #include #include +#if _HAS_CXX23 #include +#endif // _HAS_CXX23 #include +#if _HAS_CXX23 #include +#endif // _HAS_CXX23 #include #include #include diff --git a/tests/std/include/test_header_units_and_modules.hpp b/tests/std/include/test_header_units_and_modules.hpp index ce362844dc7..41b75f4d3bb 100644 --- a/tests/std/include/test_header_units_and_modules.hpp +++ b/tests/std/include/test_header_units_and_modules.hpp @@ -216,12 +216,14 @@ void test_execution() { assert(count(execution::par, begin(arr), end(arr), 0) == 4); } +#if TEST_STANDARD >= 23 void test_expected() { using namespace std; puts("Testing ."); constexpr expected test{unexpect, 42}; assert(test.error() == 42); } +#endif // TEST_STANDARD >= 23 void test_filesystem() { using namespace std; @@ -492,6 +494,7 @@ void test_ostream() { assert(os.rdbuf() == nullptr); } +#if TEST_STANDARD >= 23 void test_print() { using namespace std; puts("Testing ."); @@ -501,6 +504,7 @@ void test_print() { println(cout, "The answer to life, the universe, and everything: {}", 42); #endif // _CPPRTTI } +#endif // TEST_STANDARD >= 23 void test_queue() { using namespace std; @@ -688,6 +692,7 @@ void test_span() { static_assert(mid[0] == 22 && mid[1] == 33 && mid[2] == 44); } +#if TEST_STANDARD >= 23 void test_spanstream() { using namespace std; puts("Testing ."); @@ -720,6 +725,7 @@ void test_spanstream() { s << 10 << 20 << 30; assert(equal(begin(s.span()), end(s.span()), begin(expected_val), end(expected_val))); } +#endif // TEST_STANDARD >= 23 void test_sstream() { using namespace std; @@ -746,6 +752,7 @@ void test_stack() { assert(s.empty()); } +#if TEST_STANDARD >= 23 __declspec(dllexport) void test_stacktrace() { // export test_stacktrace to have it named even without debug info using namespace std; puts("Testing ."); @@ -761,6 +768,7 @@ __declspec(dllexport) void test_stacktrace() { // export test_stacktrace to have assert(desc == "test_stacktrace"); } +#endif // TEST_STANDARD >= 23 void test_stdexcept() { using namespace std; @@ -778,11 +786,13 @@ void test_stdexcept() { assert(caught_puppies); } +#if TEST_STANDARD >= 23 void test_stdfloat() { using namespace std; puts("Testing ."); // `namespace std` is available, so we're done. } +#endif // TEST_STANDARD >= 23 void test_stop_token() { using namespace std; @@ -1080,7 +1090,9 @@ void all_cpp_header_tests() { test_deque(); test_exception(); test_execution(); +#if TEST_STANDARD >= 23 test_expected(); +#endif // TEST_STANDARD >= 23 test_filesystem(); test_format(); test_forward_list(); @@ -1107,7 +1119,9 @@ void all_cpp_header_tests() { test_numeric(); test_optional(); test_ostream(); +#if TEST_STANDARD >= 23 test_print(); +#endif // TEST_STANDARD >= 23 test_queue(); test_random(); test_ranges(); @@ -1119,12 +1133,18 @@ void all_cpp_header_tests() { test_shared_mutex(); test_source_location(); test_span(); +#if TEST_STANDARD >= 23 test_spanstream(); +#endif // TEST_STANDARD >= 23 test_sstream(); test_stack(); +#if TEST_STANDARD >= 23 test_stacktrace(); +#endif // TEST_STANDARD >= 23 test_stdexcept(); +#if TEST_STANDARD >= 23 test_stdfloat(); +#endif // TEST_STANDARD >= 23 test_stop_token(); test_streambuf(); test_string(); diff --git a/tests/std/tests/P1502R1_standard_library_header_units/env.lst b/tests/std/tests/P1502R1_standard_library_header_units/env.lst index 9cdd80a2eb5..4912f8d803c 100644 --- a/tests/std/tests/P1502R1_standard_library_header_units/env.lst +++ b/tests/std/tests/P1502R1_standard_library_header_units/env.lst @@ -5,7 +5,8 @@ RUNALL_INCLUDE ..\..\..\universal_prefix.lst RUNALL_CROSSLIST PM_CL="/w14365 /D_ENFORCE_FACET_SPECIALIZATIONS=1 /D_STL_CALL_ABORT_INSTEAD_OF_INVALID_PARAMETER" RUNALL_CROSSLIST -PM_CL="/w14640 /Zc:threadSafeInit- /EHsc /std:c++latest" +PM_CL="/w14640 /Zc:threadSafeInit- /EHsc /DTEST_STANDARD=20 /std:c++20" +PM_CL="/w14640 /Zc:threadSafeInit- /EHsc /DTEST_STANDARD=23 /std:c++latest" RUNALL_CROSSLIST PM_CL="/Zc:preprocessor" RUNALL_CROSSLIST diff --git a/tests/std/tests/P1502R1_standard_library_header_units/test.cpp b/tests/std/tests/P1502R1_standard_library_header_units/test.cpp index f9fa3090a20..66fbc4ea5a1 100644 --- a/tests/std/tests/P1502R1_standard_library_header_units/test.cpp +++ b/tests/std/tests/P1502R1_standard_library_header_units/test.cpp @@ -27,7 +27,9 @@ import ; import ; import ; import ; +#if TEST_STANDARD >= 23 import ; +#endif // TEST_STANDARD >= 23 import ; import ; import ; @@ -54,7 +56,9 @@ import ; import ; import ; import ; +#if TEST_STANDARD >= 23 import ; +#endif // TEST_STANDARD >= 23 import ; import ; import ; @@ -66,12 +70,18 @@ import ; import ; import ; import ; +#if TEST_STANDARD >= 23 import ; +#endif // TEST_STANDARD >= 23 import ; import ; +#if TEST_STANDARD >= 23 import ; +#endif // TEST_STANDARD >= 23 import ; +#if TEST_STANDARD >= 23 import ; +#endif // TEST_STANDARD >= 23 import ; import ; import ; diff --git a/tests/std/tests/P2465R3_standard_library_modules/env.lst b/tests/std/tests/P2465R3_standard_library_modules/env.lst index 759f0d18023..c399bd0ee5f 100644 --- a/tests/std/tests/P2465R3_standard_library_modules/env.lst +++ b/tests/std/tests/P2465R3_standard_library_modules/env.lst @@ -5,7 +5,8 @@ RUNALL_INCLUDE ..\..\..\universal_prefix.lst RUNALL_CROSSLIST PM_CL="/w14365 /D_ENFORCE_FACET_SPECIALIZATIONS=1 /D_STL_CALL_ABORT_INSTEAD_OF_INVALID_PARAMETER" RUNALL_CROSSLIST -PM_CL="/w14640 /Zc:threadSafeInit- /EHsc /std:c++latest" +PM_CL="/w14640 /Zc:threadSafeInit- /EHsc /DTEST_STANDARD=20 /std:c++20" +PM_CL="/w14640 /Zc:threadSafeInit- /EHsc /DTEST_STANDARD=23 /std:c++latest" RUNALL_CROSSLIST PM_CL="/Zc:preprocessor" RUNALL_CROSSLIST diff --git a/tests/std/tests/VSO_0157762_feature_test_macros/test.compile.pass.cpp b/tests/std/tests/VSO_0157762_feature_test_macros/test.compile.pass.cpp index 177381531f3..e130dd7f546 100644 --- a/tests/std/tests/VSO_0157762_feature_test_macros/test.compile.pass.cpp +++ b/tests/std/tests/VSO_0157762_feature_test_macros/test.compile.pass.cpp @@ -1506,7 +1506,7 @@ STATIC_ASSERT(__cpp_lib_memory_resource == 201603L); #endif #endif -#if _HAS_CXX23 && !defined(__clang__) && !defined(__EDG__) // TRANSITION, Clang and EDG support for modules +#if _HAS_CXX20 && !defined(__clang__) && !defined(__EDG__) // TRANSITION, Clang and EDG support for modules #ifndef __cpp_lib_modules #error __cpp_lib_modules is not defined #elif __cpp_lib_modules != 202207L From b186392ad9c2d8e78b437382de1419c4e14216cc Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Thu, 31 Aug 2023 09:45:08 -0700 Subject: [PATCH 11/21] Avoid VSO-1854243 in `P0339R6_polymorphic_allocator` (#3987) The ASan runtime refuses to throw exceptions for overlarge allocations. --- tests/std/tests/P0339R6_polymorphic_allocator/test.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/std/tests/P0339R6_polymorphic_allocator/test.cpp b/tests/std/tests/P0339R6_polymorphic_allocator/test.cpp index 374ec7d0b4e..0245ba354bd 100644 --- a/tests/std/tests/P0339R6_polymorphic_allocator/test.cpp +++ b/tests/std/tests/P0339R6_polymorphic_allocator/test.cpp @@ -69,6 +69,7 @@ void allocate_object_overflow_test() { polymorphic_allocator<> alloc{}; +#ifndef __SANITIZE_ADDRESS__ // TRANSITION, VSO-1854243 try { int* vp = alloc.allocate_object(threshold); alloc.deallocate_object(vp, threshold); @@ -76,6 +77,7 @@ void allocate_object_overflow_test() { } catch (...) { assert(false); } +#endif // TRANSITION, VSO-1854243 try { [[maybe_unused]] int* vp = alloc.allocate_object(threshold + 1); From 46ca2d72d934659d9ca5bcd0ba5d62a2979807ba Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Thu, 31 Aug 2023 09:49:05 -0700 Subject: [PATCH 12/21] Don't `memcmp(x, y, -1)` from `ranges::lexicographical_compare` (#3989) ... even with two potentially-infinite ranges. Drive by: Pull non-dependent test cases out of the `instantiator::call` template magic in `tests/P0896R4_ranges_alg_lexicographical_compare`. Fixes VSO-1854238 --- stl/inc/algorithm | 2 +- .../test.cpp | 62 +++++++++++-------- 2 files changed, 36 insertions(+), 28 deletions(-) diff --git a/stl/inc/algorithm b/stl/inc/algorithm index 5c4d8b8f01c..8908619edfe 100644 --- a/stl/inc/algorithm +++ b/stl/inc/algorithm @@ -10654,7 +10654,7 @@ namespace ranges { constexpr bool _Is_sized2 = sized_sentinel_for<_Se2, _It2>; if constexpr (!is_void_v<_Memcmp_classification_pred> && _Sized_or_unreachable_sentinel_for<_Se1, _It1> && _Sized_or_unreachable_sentinel_for<_Se2, _It2> && same_as<_Pj1, identity> - && same_as<_Pj2, identity>) { + && same_as<_Pj2, identity> && (_Is_sized1 || _Is_sized2)) { if (!_STD is_constant_evaluated()) { size_t _Num1; if constexpr (_Is_sized1) { diff --git a/tests/std/tests/P0896R4_ranges_alg_lexicographical_compare/test.cpp b/tests/std/tests/P0896R4_ranges_alg_lexicographical_compare/test.cpp index fa4ec994a72..f3a775346a6 100644 --- a/tests/std/tests/P0896R4_ranges_alg_lexicographical_compare/test.cpp +++ b/tests/std/tests/P0896R4_ranges_alg_lexicographical_compare/test.cpp @@ -194,40 +194,46 @@ struct instantiator { empty1.begin(), empty1.end(), empty2.begin(), empty2.end(), less{}, get_first, get_second); assert(!result); } - { // Validate memcmp case - unsigned char arr1[3]{0, 1, 2}; - unsigned char arr2[3]{0, 1, 3}; - assert(lexicographical_compare(arr1, arr2)); - arr2[2] = 2; - assert(!lexicographical_compare(arr1, arr2)); - arr2[2] = 1; - assert(!lexicographical_compare(arr1, arr2)); - } - { // Validate memcmp + unreachable_sentinel cases - unsigned char arr1[3]{0, 1, 2}; - unsigned char arr2[3]{0, 1, 3}; - - assert(lexicographical_compare(begin(arr1), end(arr1), begin(arr1), unreachable_sentinel)); - assert(!lexicographical_compare(begin(arr1), unreachable_sentinel, begin(arr1), end(arr1))); - - assert(lexicographical_compare(begin(arr1), unreachable_sentinel, begin(arr2), unreachable_sentinel)); - assert(lexicographical_compare(begin(arr1), unreachable_sentinel, begin(arr2), end(arr2))); - assert(lexicographical_compare(begin(arr1), end(arr1), begin(arr2), unreachable_sentinel)); - arr2[2] = 2; - assert(!lexicographical_compare(begin(arr1), unreachable_sentinel, begin(arr2), end(arr2))); - assert(lexicographical_compare(begin(arr1), end(arr1), begin(arr2), unreachable_sentinel)); - arr2[2] = 1; - assert(!lexicographical_compare(begin(arr1), unreachable_sentinel, begin(arr2), unreachable_sentinel)); - assert(!lexicographical_compare(begin(arr1), unreachable_sentinel, begin(arr2), end(arr2))); - assert(!lexicographical_compare(begin(arr1), end(arr1), begin(arr2), unreachable_sentinel)); - } } }; +constexpr void concrete_tests() { + using ranges::lexicographical_compare, ranges::begin, ranges::end; + + { // Validate memcmp case + unsigned char arr1[3]{0, 1, 2}; + unsigned char arr2[3]{0, 1, 3}; + assert(lexicographical_compare(arr1, arr2)); + arr2[2] = 2; + assert(!lexicographical_compare(arr1, arr2)); + arr2[2] = 1; + assert(!lexicographical_compare(arr1, arr2)); + } + { // Validate memcmp + unreachable_sentinel cases + unsigned char arr1[3]{0, 1, 2}; + unsigned char arr2[3]{0, 1, 3}; + + assert(lexicographical_compare(begin(arr1), end(arr1), begin(arr1), unreachable_sentinel)); + assert(!lexicographical_compare(begin(arr1), unreachable_sentinel, begin(arr1), end(arr1))); + + assert(lexicographical_compare(begin(arr1), unreachable_sentinel, begin(arr2), unreachable_sentinel)); + assert(lexicographical_compare(begin(arr1), unreachable_sentinel, begin(arr2), end(arr2))); + assert(lexicographical_compare(begin(arr1), end(arr1), begin(arr2), unreachable_sentinel)); + arr2[2] = 2; + assert(!lexicographical_compare(begin(arr1), unreachable_sentinel, begin(arr2), end(arr2))); + assert(lexicographical_compare(begin(arr1), end(arr1), begin(arr2), unreachable_sentinel)); + arr2[2] = 1; + assert(!lexicographical_compare(begin(arr1), unreachable_sentinel, begin(arr2), unreachable_sentinel)); + assert(!lexicographical_compare(begin(arr1), unreachable_sentinel, begin(arr2), end(arr2))); + assert(!lexicographical_compare(begin(arr1), end(arr1), begin(arr2), unreachable_sentinel)); + } +} + #ifdef TEST_EVERYTHING int main() { // No constexpr tests here: we hit the constexpr step limits too quickly. test_in_in(); + concrete_tests(); } #else // ^^^ test all range combinations / test only interesting combinations vvv template @@ -243,6 +249,8 @@ constexpr void run_tests() { instantiator::call, range_type>(); instantiator::call, range_type>(); instantiator::call, range_type>(); + + concrete_tests(); } int main() { From 6c69a73911b33892919ec628c0ea5bbf0caf8a6a Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Thu, 31 Aug 2023 09:49:43 -0700 Subject: [PATCH 13/21] Don't violate preconditions in tr1/regex3 (#3990) This test constructs a `regex_iterator` and a `regex_token_iterator` with invalid character ranges. The first occurrence is benign - the test never directs the library to examine the bogus part of the range - but the second case ventures into the land of pure undefined behavior. Caught by ASan. Fixes VSO-1854241 --- tests/tr1/tests/regex3/test.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/tr1/tests/regex3/test.cpp b/tests/tr1/tests/regex3/test.cpp index d74486aa3cd..1c9c9465cf4 100644 --- a/tests/tr1/tests/regex3/test.cpp +++ b/tests/tr1/tests/regex3/test.cpp @@ -389,12 +389,12 @@ static void test_capturegroups() { static void test_iterators() { // needs refining after ++ fixed const CHR* pat = T("ax"); MyIter::regex_type rx(T("a")); - MyIter iter(pat, pat + xlen(pat) + 10, rx); + MyIter iter(pat, pat + xlen(pat), rx); CHECKSTR(iter->str().c_str(), T("a")); STD match_results mr = *iter; CHECK_INT(mr.position(0), 0); CHECK_INT(mr.length(0), 1); - MyTokIter toIter(pat, pat + xlen(pat) + 10, rx); + MyTokIter toIter(pat, pat + xlen(pat), rx); CHECKSTR(toIter->str().c_str(), T("a")); toIter++; #if NO_EXCEPTIONS From 9b468b35904e189751e6a0c340d341c74ef3fc20 Mon Sep 17 00:00:00 2001 From: achabense <60953653+achabense@users.noreply.github.com> Date: Fri, 8 Sep 2023 05:06:57 +0800 Subject: [PATCH 14/21] Remove some `#ifdef _CRTBLD` blocks (#3964) --- stl/inc/xthreads.h | 5 ----- stl/inc/yvals.h | 21 --------------------- stl/src/awint.hpp | 2 ++ stl/src/cerr.cpp | 2 +- stl/src/cin.cpp | 2 +- stl/src/clog.cpp | 2 +- stl/src/cond.cpp | 12 ++++++++++++ stl/src/cout.cpp | 2 +- stl/src/mutex.cpp | 10 ---------- stl/src/wcerr.cpp | 2 +- stl/src/wcin.cpp | 2 +- stl/src/wclog.cpp | 2 +- stl/src/wcout.cpp | 2 +- stl/src/xmtx.hpp | 9 +++++++++ 14 files changed, 31 insertions(+), 44 deletions(-) diff --git a/stl/inc/xthreads.h b/stl/inc/xthreads.h index 26302f0aea3..7f78cec33f9 100644 --- a/stl/inc/xthreads.h +++ b/stl/inc/xthreads.h @@ -107,11 +107,6 @@ _CRTIMP2_PURE _Thrd_result __cdecl _Mtx_lock(_Mtx_t); _CRTIMP2_PURE _Thrd_result __cdecl _Mtx_trylock(_Mtx_t); _CRTIMP2_PURE _Thrd_result __cdecl _Mtx_unlock(_Mtx_t); // TRANSITION, ABI: Always succeeds -#ifdef _CRTBLD -_CRTIMP2_PURE void __cdecl _Mtx_clear_owner(_Mtx_t); -_CRTIMP2_PURE void __cdecl _Mtx_reset_owner(_Mtx_t); -#endif // _CRTBLD - // shared mutex // these declarations must be in sync with those in sharedmutex.cpp void __cdecl _Smtx_lock_exclusive(_Smtx_t*); diff --git a/stl/inc/yvals.h b/stl/inc/yvals.h index 8702c037e2a..9f337dad050 100644 --- a/stl/inc/yvals.h +++ b/stl/inc/yvals.h @@ -275,14 +275,6 @@ _EMIT_STL_WARNING(STL4001, "/clr:pure is deprecated and will be REMOVED."); #endif #endif // _CRTIMP2_PURE -#ifdef _CRTBLD -// These functions are for enabling STATIC_CPPLIB functionality -#define _cpp_stdin (__acrt_iob_func(0)) -#define _cpp_stdout (__acrt_iob_func(1)) -#define _cpp_stderr (__acrt_iob_func(2)) -#define _cpp_isleadbyte(c) (__pctype_func()[static_cast(c)] & _LEADBYTE) -#endif // defined(_CRTBLD) - #ifndef _CRTIMP2_IMPORT #if defined(CRTDLL2) && defined(_CRTBLD) #define _CRTIMP2_IMPORT __declspec(dllexport) @@ -449,19 +441,6 @@ class _CRTIMP2_PURE_IMPORT _EmptyLockit { // empty lock class used for bin compa #define _END_LOCINFO() } #endif // ^^^ !defined(_M_CEE) ^^^ -#ifdef _CRTBLD - -#ifdef _M_CEE -#define _RELIABILITY_CONTRACT \ - [System::Runtime::ConstrainedExecution::ReliabilityContract( \ - System::Runtime::ConstrainedExecution::Consistency::WillNotCorruptState, \ - System::Runtime::ConstrainedExecution::Cer::Success)] -#else // ^^^ defined(_M_CEE) / !defined(_M_CEE) vvv -#define _RELIABILITY_CONTRACT -#endif // ^^^ !defined(_M_CEE) ^^^ - -#endif // defined(_CRTBLD) - #if _HAS_EXCEPTIONS #define _TRY_BEGIN try { #define _CATCH(x) \ diff --git a/stl/src/awint.hpp b/stl/src/awint.hpp index acb1667e736..24052ffefa4 100644 --- a/stl/src/awint.hpp +++ b/stl/src/awint.hpp @@ -10,6 +10,8 @@ #include +#define _cpp_isleadbyte(c) (__pctype_func()[static_cast(c)] & _LEADBYTE) + _CRT_BEGIN_C_HEADER #if _STL_WIN32_WINNT >= _WIN32_WINNT_WIN8 diff --git a/stl/src/cerr.cpp b/stl/src/cerr.cpp index a8db79602ce..3a5f23ce49d 100644 --- a/stl/src/cerr.cpp +++ b/stl/src/cerr.cpp @@ -14,7 +14,7 @@ static std::_Init_locks initlocks; _STD_BEGIN -__PURE_APPDOMAIN_GLOBAL static filebuf ferr(_cpp_stderr); +__PURE_APPDOMAIN_GLOBAL static filebuf ferr(stderr); #if defined(_M_CEE_PURE) __PURE_APPDOMAIN_GLOBAL extern ostream cerr(&ferr); diff --git a/stl/src/cin.cpp b/stl/src/cin.cpp index 68fec6a6e55..6c7b4679817 100644 --- a/stl/src/cin.cpp +++ b/stl/src/cin.cpp @@ -14,7 +14,7 @@ static std::_Init_locks initlocks; _STD_BEGIN -__PURE_APPDOMAIN_GLOBAL static filebuf fin(_cpp_stdin); +__PURE_APPDOMAIN_GLOBAL static filebuf fin(stdin); #if defined(_M_CEE_PURE) __PURE_APPDOMAIN_GLOBAL extern istream cin(&fin); diff --git a/stl/src/clog.cpp b/stl/src/clog.cpp index 6ae37572e27..e29b72ec85c 100644 --- a/stl/src/clog.cpp +++ b/stl/src/clog.cpp @@ -16,7 +16,7 @@ static std::_Init_locks initlocks; _STD_BEGIN -__PURE_APPDOMAIN_GLOBAL static filebuf flog(_cpp_stderr); +__PURE_APPDOMAIN_GLOBAL static filebuf flog(stderr); #if defined(_M_CEE_PURE) __PURE_APPDOMAIN_GLOBAL extern ostream clog(&flog); diff --git a/stl/src/cond.cpp b/stl/src/cond.cpp index 01d964ef6f3..fa094b04407 100644 --- a/stl/src/cond.cpp +++ b/stl/src/cond.cpp @@ -48,6 +48,18 @@ _CRTIMP2_PURE void __cdecl _Cnd_destroy(const _Cnd_t cond) { // clean up } } +// TRANSITION, ABI: should be static; dllexported for binary compatibility +_CRTIMP2_PURE void __cdecl _Mtx_clear_owner(_Mtx_t mtx) { // set owner to nobody + mtx->_Thread_id = -1; + --mtx->_Count; +} + +// TRANSITION, ABI: should be static; dllexported for binary compatibility +_CRTIMP2_PURE void __cdecl _Mtx_reset_owner(_Mtx_t mtx) { // set owner to current thread + mtx->_Thread_id = static_cast(GetCurrentThreadId()); + ++mtx->_Count; +} + _CRTIMP2_PURE _Thrd_result __cdecl _Cnd_wait(const _Cnd_t cond, const _Mtx_t mtx) { // wait until signaled const auto cs = &mtx->_Critical_section; _Mtx_clear_owner(mtx); diff --git a/stl/src/cout.cpp b/stl/src/cout.cpp index 60f8445c732..02ab1f7eb27 100644 --- a/stl/src/cout.cpp +++ b/stl/src/cout.cpp @@ -14,7 +14,7 @@ static std::_Init_locks initlocks; _STD_BEGIN -__PURE_APPDOMAIN_GLOBAL static filebuf fout(_cpp_stdout); +__PURE_APPDOMAIN_GLOBAL static filebuf fout(stdout); #if defined(_M_CEE_PURE) __PURE_APPDOMAIN_GLOBAL extern ostream cout(&fout); diff --git a/stl/src/mutex.cpp b/stl/src/mutex.cpp index ba8c2de344f..98cf98d1cdf 100644 --- a/stl/src/mutex.cpp +++ b/stl/src/mutex.cpp @@ -189,16 +189,6 @@ _CRTIMP2_PURE void* __cdecl _Mtx_getconcrtcs(_Mtx_t mtx) { // get internal cs im return &mtx->_Critical_section; } -_CRTIMP2_PURE void __cdecl _Mtx_clear_owner(_Mtx_t mtx) { // set owner to nobody - mtx->_Thread_id = -1; - --mtx->_Count; -} - -_CRTIMP2_PURE void __cdecl _Mtx_reset_owner(_Mtx_t mtx) { // set owner to current thread - mtx->_Thread_id = static_cast(GetCurrentThreadId()); - ++mtx->_Count; -} - _END_EXTERN_C /* diff --git a/stl/src/wcerr.cpp b/stl/src/wcerr.cpp index c2ff56b6ec8..41537b600b8 100644 --- a/stl/src/wcerr.cpp +++ b/stl/src/wcerr.cpp @@ -14,7 +14,7 @@ static std::_Init_locks initlocks; _STD_BEGIN -__PURE_APPDOMAIN_GLOBAL static wfilebuf wferr(_cpp_stderr); +__PURE_APPDOMAIN_GLOBAL static wfilebuf wferr(stderr); #if defined(_M_CEE_PURE) __PURE_APPDOMAIN_GLOBAL extern wostream wcerr(&wferr); #else diff --git a/stl/src/wcin.cpp b/stl/src/wcin.cpp index f5c7a1a5e70..bc5008776d9 100644 --- a/stl/src/wcin.cpp +++ b/stl/src/wcin.cpp @@ -14,7 +14,7 @@ static std::_Init_locks initlocks; _STD_BEGIN -__PURE_APPDOMAIN_GLOBAL static wfilebuf wfin(_cpp_stdin); +__PURE_APPDOMAIN_GLOBAL static wfilebuf wfin(stdin); #if defined(_M_CEE_PURE) __PURE_APPDOMAIN_GLOBAL extern wistream wcin(&wfin); #else diff --git a/stl/src/wclog.cpp b/stl/src/wclog.cpp index 513f7b9105a..3ac05b10172 100644 --- a/stl/src/wclog.cpp +++ b/stl/src/wclog.cpp @@ -14,7 +14,7 @@ static std::_Init_locks initlocks; _STD_BEGIN -__PURE_APPDOMAIN_GLOBAL static wfilebuf wflog(_cpp_stderr); +__PURE_APPDOMAIN_GLOBAL static wfilebuf wflog(stderr); #if defined(_M_CEE_PURE) __PURE_APPDOMAIN_GLOBAL extern wostream wclog(&wflog); #else diff --git a/stl/src/wcout.cpp b/stl/src/wcout.cpp index fc574d689c3..c9693987eb9 100644 --- a/stl/src/wcout.cpp +++ b/stl/src/wcout.cpp @@ -14,7 +14,7 @@ static std::_Init_locks initlocks; _STD_BEGIN -__PURE_APPDOMAIN_GLOBAL static wfilebuf wfout(_cpp_stdout); +__PURE_APPDOMAIN_GLOBAL static wfilebuf wfout(stdout); #if defined(_M_CEE_PURE) __PURE_APPDOMAIN_GLOBAL extern wostream wcout(&wfout); #else diff --git a/stl/src/xmtx.hpp b/stl/src/xmtx.hpp index f36af7acfcd..2d5b7d1df5b 100644 --- a/stl/src/xmtx.hpp +++ b/stl/src/xmtx.hpp @@ -9,6 +9,15 @@ #include +#ifdef _M_CEE +#define _RELIABILITY_CONTRACT \ + [System::Runtime::ConstrainedExecution::ReliabilityContract( \ + System::Runtime::ConstrainedExecution::Consistency::WillNotCorruptState, \ + System::Runtime::ConstrainedExecution::Cer::Success)] +#else // ^^^ defined(_M_CEE) / !defined(_M_CEE) vvv +#define _RELIABILITY_CONTRACT +#endif // ^^^ !defined(_M_CEE) ^^^ + _EXTERN_C_UNLESS_PURE using _Rmtx = CRITICAL_SECTION; From d16d735cb62d98619bf303625999700cacc2d360 Mon Sep 17 00:00:00 2001 From: achabense <60953653+achabense@users.noreply.github.com> Date: Fri, 8 Sep 2023 05:09:05 +0800 Subject: [PATCH 15/21] Cleanups for `` (#3973) --- stl/inc/chrono | 11 +++++------ stl/inc/exception | 23 ++++++++--------------- stl/inc/xmemory | 4 ++++ 3 files changed, 17 insertions(+), 21 deletions(-) diff --git a/stl/inc/chrono b/stl/inc/chrono index f8cb5a98746..d57acea0a2e 100644 --- a/stl/inc/chrono +++ b/stl/inc/chrono @@ -5293,14 +5293,14 @@ namespace chrono { if constexpr (_Is_specialization_v<_Ty, duration>) { if constexpr (!treat_as_floating_point_v) { if (_Specs._Precision != -1) { - _THROW(format_error("Precision specification invalid for chrono::duration type with " - "integral representation type, see N4950 [time.format]/1.")); + _Throw_format_error("Precision specification invalid for chrono::duration type with " + "integral representation type, see N4950 [time.format]/1."); } } } else { if (_Specs._Precision != -1) { - _THROW(format_error("Precision specification invalid for non-chrono::duration type, " - "see N4950 [time.format]/1.")); + _Throw_format_error("Precision specification invalid for non-chrono::duration type, " + "see N4950 [time.format]/1."); } } @@ -5747,8 +5747,7 @@ namespace chrono { return true; } else if constexpr (is_same_v<_Ty, month_day_last>) { if (_Val.month() >= February) { - _THROW( - format_error("The day of year for a month_day_last other than January is ambiguous")); + _Throw_format_error("The day of year for a month_day_last other than January is ambiguous"); } return true; } else if constexpr (_Is_ymd) { diff --git a/stl/inc/exception b/stl/inc/exception index 72bf3d74edf..afda3fb4b21 100644 --- a/stl/inc/exception +++ b/stl/inc/exception @@ -253,12 +253,6 @@ public: return __ExceptionPtrToBool(this); } - static exception_ptr _Current_exception() noexcept { - exception_ptr _Retval; - __ExceptionPtrCurrentException(&_Retval); - return _Retval; - } - static exception_ptr _Copy_exception(_In_ void* _Except, _In_ const void* _Ptr) { exception_ptr _Retval; if (!_Ptr) { @@ -312,7 +306,9 @@ private: }; _EXPORT_STD _NODISCARD inline exception_ptr current_exception() noexcept { - return exception_ptr::_Current_exception(); + exception_ptr _Retval; + __ExceptionPtrCurrentException(&_Retval); + return _Retval; } _EXPORT_STD [[noreturn]] inline void rethrow_exception(_In_ exception_ptr _Ptr) { @@ -327,10 +323,6 @@ _NODISCARD_SMART_PTR_ALLOC exception_ptr make_exception_ptr(_Ex _Except) noexcep return exception_ptr::_Copy_exception(_STD addressof(_Except), __GetExceptionInfo(_Except)); } -[[noreturn]] inline void _Throw_bad_array_new_length() { - _THROW(bad_array_new_length{}); -} - _EXPORT_STD class nested_exception { // wrap an exception_ptr public: nested_exception() noexcept : _Exc(_STD current_exception()) {} @@ -355,9 +347,10 @@ private: exception_ptr _Exc; }; -template -struct _With_nested : _Uty, nested_exception { // glue user exception to nested_exception - explicit _With_nested(_Ty&& _Arg) +template +struct _With_nested_v2 : _Uty, nested_exception { // glue user exception to nested_exception + template + explicit _With_nested_v2(_Ty&& _Arg) : _Uty(_STD forward<_Ty>(_Arg)), nested_exception() {} // store user exception and current_exception() }; @@ -368,7 +361,7 @@ _EXPORT_STD template if constexpr (is_class_v<_Uty> && !is_base_of_v && !is_final_v<_Uty>) { // throw user exception glued to nested_exception - using _Glued = _With_nested<_Ty, _Uty>; + using _Glued = _With_nested_v2<_Uty>; _THROW(_Glued(_STD forward<_Ty>(_Arg))); } else { // throw user exception by itself diff --git a/stl/inc/xmemory b/stl/inc/xmemory index 75c315c4477..a612d99d103 100644 --- a/stl/inc/xmemory +++ b/stl/inc/xmemory @@ -60,6 +60,10 @@ template _INLINE_VAR constexpr bool _Nothrow_compare = noexcept( static_cast(_STD declval()(_STD declval(), _STD declval()))); +[[noreturn]] inline void _Throw_bad_array_new_length() { + _THROW(bad_array_new_length{}); +} + template _NODISCARD constexpr size_t _Get_size_of_n(const size_t _Count) { constexpr bool _Overflow_is_possible = _Ty_size > 1; From f98b286a17e7c72e3fa10297868b877f9cdc0fa8 Mon Sep 17 00:00:00 2001 From: achabense <60953653+achabense@users.noreply.github.com> Date: Fri, 8 Sep 2023 05:12:04 +0800 Subject: [PATCH 16/21] Fix `num_get`'s float-parsing problem (#3982) --- stl/inc/xlocnum | 4 ---- .../LWG2381_num_get_floating_point/test.cpp | 21 +++++++++++++++++++ 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/stl/inc/xlocnum b/stl/inc/xlocnum index 617e42d051d..86c19b22c9c 100644 --- a/stl/inc/xlocnum +++ b/stl/inc/xlocnum @@ -1019,10 +1019,6 @@ private: _Seendigit = true; } - if (_Seendigit) { - *_Ptr++ = '0'; // put one back - } - for (size_t _Idx; _First != _Last && (_Idx = _STD _Find_elem(_Atoms, *_First)) < _Offset_dec_digit_end; _Seendigit = true, (void) ++_First) { if (_Exponent_part < PTRDIFF_MAX / 10 diff --git a/tests/std/tests/LWG2381_num_get_floating_point/test.cpp b/tests/std/tests/LWG2381_num_get_floating_point/test.cpp index f6c03babb5d..7f0615f97e2 100644 --- a/tests/std/tests/LWG2381_num_get_floating_point/test.cpp +++ b/tests/std/tests/LWG2381_num_get_floating_point/test.cpp @@ -532,6 +532,23 @@ void test_gh_3378() { } } +// Also test GH-3980 : Wrong reading of float values +template +void test_gh_3980() { + auto test_case = [](const char* str, double expected) { + Flt val = 0; + istringstream{str} >> val; + assert((ostringstream{} << val).str() == (ostringstream{} << expected).str()); + }; + + test_case("0x1p+07", 0x1p+07); + test_case("1e+07", 1e+07); + test_case("1e+0", 1); + test_case("1e-0", 1); + test_case("1e-07", 1e-07); + test_case("0x1p-07", 0x1p-07); +} + #if _HAS_CXX17 void test_float_from_char_cases() { for (const auto& test_case : float_from_chars_test_cases) { @@ -589,6 +606,10 @@ int main() { test_gh_3378(); test_gh_3378(); + test_gh_3980(); + test_gh_3980(); + test_gh_3980(); + #if _HAS_CXX17 test_float_from_char_cases(); test_double_from_char_cases(); From d97e997849cd52afd8707684044685f1c26718da Mon Sep 17 00:00:00 2001 From: kissholic Date: Fri, 8 Sep 2023 05:35:52 +0800 Subject: [PATCH 17/21] Update _MSVC_STL_UPDATE to September 2023 (#4003) --- stl/inc/yvals_core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stl/inc/yvals_core.h b/stl/inc/yvals_core.h index 09d2cc7eaa9..b013fdc5775 100644 --- a/stl/inc/yvals_core.h +++ b/stl/inc/yvals_core.h @@ -873,7 +873,7 @@ #define _CPPLIB_VER 650 #define _MSVC_STL_VERSION 143 -#define _MSVC_STL_UPDATE 202308L +#define _MSVC_STL_UPDATE 202309L #ifndef _ALLOW_COMPILER_AND_STL_VERSION_MISMATCH #if defined(__CUDACC__) && defined(__CUDACC_VER_MAJOR__) From db6379e9ccce21bb7520639e4b94c5c8de1eeab6 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Thu, 7 Sep 2023 14:38:18 -0700 Subject: [PATCH 18/21] Remove `/clr` test workarounds (#4012) --- tests/std/include/range_algorithm_support.hpp | 14 -------------- tests/std/include/test_atomic_wait.hpp | 18 ++---------------- tests/std/tests/P0019R8_atomic_ref/test.cpp | 2 -- .../P0024R2_parallel_algorithms_equal/test.cpp | 2 -- .../test.cpp | 2 -- .../test.cpp | 2 -- .../test.cpp | 2 -- .../test.cpp | 2 -- .../test.cpp | 2 -- .../test.cpp | 2 -- .../test.cpp | 2 -- .../tests/P0896R4_ranges_alg_equal/test.cpp | 2 -- tests/std/tests/P0896R4_views_drop/test.cpp | 2 -- .../std/tests/P0896R4_views_elements/test.cpp | 2 -- tests/std/tests/P0896R4_views_iota/test.cpp | 2 -- tests/std/tests/P0896R4_views_take/test.cpp | 2 -- .../tests/P1135R6_atomic_flag_test/test.cpp | 2 -- .../std/tests/P1522R1_difference_type/test.cpp | 4 ---- 18 files changed, 2 insertions(+), 64 deletions(-) diff --git a/tests/std/include/range_algorithm_support.hpp b/tests/std/include/range_algorithm_support.hpp index 056c89aa0d5..484bc670c03 100644 --- a/tests/std/include/range_algorithm_support.hpp +++ b/tests/std/include/range_algorithm_support.hpp @@ -12,10 +12,6 @@ #include #include -#ifdef _M_CEE // TRANSITION, VSO-1867037 -#include -#endif // ^^^ workaround ^^^ - #define STATIC_ASSERT(...) static_assert(__VA_ARGS__, #__VA_ARGS__) namespace ranges = std::ranges; @@ -72,21 +68,11 @@ template struct holder { STATIC_ASSERT(N < ~std::size_t{0} / sizeof(T)); -#ifdef _M_CEE // TRANSITION, VSO-1867037 - unsigned char space[(N + 1) * sizeof(T)]; - - auto as_span() { - void* buffer_ptr = space; - std::size_t buffer_len = sizeof(space); - return std::span{static_cast(std::align(alignof(T), sizeof(T), buffer_ptr, buffer_len)), N}; - } -#else // ^^^ workaround / no workaround vvv alignas(T) unsigned char space[N * sizeof(T)]; auto as_span() { return std::span{reinterpret_cast(space + 0), N}; } -#endif // ^^^ no workaround ^^^ }; namespace test { diff --git a/tests/std/include/test_atomic_wait.hpp b/tests/std/include/test_atomic_wait.hpp index d3c2180f924..16ca07aa9ce 100644 --- a/tests/std/include/test_atomic_wait.hpp +++ b/tests/std/include/test_atomic_wait.hpp @@ -74,13 +74,7 @@ void test_atomic_wait_func(UnderlyingType old_value, const UnderlyingType new_va template void test_atomic_wait_func_ptr(UnderlyingType old_value, const UnderlyingType new_value, const std::chrono::steady_clock::duration waiting_duration) { -#ifdef _M_CEE // TRANSITION, VSO-1665654 - (void) old_value; - (void) new_value; - (void) waiting_duration; -#else // ^^^ workaround / no workaround vvv test_atomic_wait_func_impl(old_value, new_value, waiting_duration); -#endif // ^^^ no workaround ^^^ } @@ -114,14 +108,8 @@ void test_notify_all_notifies_all(UnderlyingType old_value, const UnderlyingType template void test_notify_all_notifies_all_ptr(UnderlyingType old_value, const UnderlyingType new_value, const std::chrono::steady_clock::duration waiting_duration) { -#ifdef _M_CEE // TRANSITION, VSO-1665654 - (void) old_value; - (void) new_value; - (void) waiting_duration; -#else // ^^^ workaround / no workaround vvv // increased waiting_duration because timing assumption might not hold for atomic smart pointers test_notify_all_notifies_all_impl(old_value, new_value, 3 * waiting_duration); -#endif // ^^^ no workaround ^^^ } @@ -172,12 +160,8 @@ void test_pad_bits_impl(const std::chrono::steady_clock::duration waiting_durati template void test_pad_bits(const std::chrono::steady_clock::duration waiting_duration) { -#ifdef _M_CEE // TRANSITION, VSO-1665654 - (void) waiting_duration; -#else // ^^^ workaround / no workaround vvv test_pad_bits_impl(waiting_duration); test_pad_bits_impl(waiting_duration); -#endif // ^^^ no workaround ^^^ } struct two_shorts { @@ -302,7 +286,9 @@ inline void test_atomic_wait() { #ifndef __clang__ // TRANSITION, LLVM-46685 test_pad_bits>(waiting_duration); test_pad_bits>(waiting_duration); +#if !(defined(_M_CEE) && defined(_M_IX86)) // TRANSITION, VSO-1881472 test_pad_bits>(waiting_duration); +#endif // ^^^ no workaround ^^^ #ifndef _M_ARM test_pad_bits>(waiting_duration); test_pad_bits>(waiting_duration); diff --git a/tests/std/tests/P0019R8_atomic_ref/test.cpp b/tests/std/tests/P0019R8_atomic_ref/test.cpp index df504bce247..fa119be524a 100644 --- a/tests/std/tests/P0019R8_atomic_ref/test.cpp +++ b/tests/std/tests/P0019R8_atomic_ref/test.cpp @@ -37,7 +37,6 @@ struct int128 { template void test_ops() { -#ifndef _M_CEE // TRANSITION, VSO-1659695 constexpr std::size_t unique = 80; // small to avoid overflow even for char constexpr std::size_t repetitions = 8000; constexpr std::size_t total = unique * repetitions; @@ -85,7 +84,6 @@ void test_ops() { assert(std::transform_reduce(par, refs.begin(), refs.end(), 0, std::plus{}, load) == range * repetitions * 2); assert(std::transform_reduce(par, refs.begin(), refs.end(), 0, std::plus{}, xchg0) == range * 2); assert(std::transform_reduce(par, refs.begin(), refs.end(), 0, std::plus{}, load) == 0); -#endif // _M_CEE } template diff --git a/tests/std/tests/P0024R2_parallel_algorithms_equal/test.cpp b/tests/std/tests/P0024R2_parallel_algorithms_equal/test.cpp index c3a395e1dc6..ea53a505737 100644 --- a/tests/std/tests/P0024R2_parallel_algorithms_equal/test.cpp +++ b/tests/std/tests/P0024R2_parallel_algorithms_equal/test.cpp @@ -80,9 +80,7 @@ void test_case_equal_parallel(const size_t testSize) { } int main() { -#ifndef _M_CEE // TRANSITION, VSO-1659695 parallel_test_case(test_case_equal_parallel); parallel_test_case(test_case_equal_parallel); parallel_test_case(test_case_equal_parallel); -#endif // _M_CEE } diff --git a/tests/std/tests/P0024R2_parallel_algorithms_for_each/test.cpp b/tests/std/tests/P0024R2_parallel_algorithms_for_each/test.cpp index f5955af4940..ecfbea2801f 100644 --- a/tests/std/tests/P0024R2_parallel_algorithms_for_each/test.cpp +++ b/tests/std/tests/P0024R2_parallel_algorithms_for_each/test.cpp @@ -69,7 +69,6 @@ struct test_case_for_each_n_parallel { }; int main() { -#ifndef _M_CEE // TRANSITION, VSO-1659695 test_case_for_each_n(); parallel_test_case(test_case_for_each_parallel{}, par); parallel_test_case(test_case_for_each_parallel{}, par); @@ -85,5 +84,4 @@ int main() { parallel_test_case(test_case_for_each_n_parallel{}, unseq); parallel_test_case(test_case_for_each_n_parallel{}, unseq); #endif // _HAS_CXX20 -#endif // _M_CEE } diff --git a/tests/std/tests/P0024R2_parallel_algorithms_inclusive_scan/test.cpp b/tests/std/tests/P0024R2_parallel_algorithms_inclusive_scan/test.cpp index 769090a18db..eddb7b3b6b8 100644 --- a/tests/std/tests/P0024R2_parallel_algorithms_inclusive_scan/test.cpp +++ b/tests/std/tests/P0024R2_parallel_algorithms_inclusive_scan/test.cpp @@ -207,7 +207,6 @@ void test_case_inclusive_scan_init_writes_intermediate_type() { } int main() { -#ifndef _M_CEE // TRANSITION, VSO-1659695 mt19937 gen(1729); parallel_test_case(test_case_inclusive_scan_parallel, gen); @@ -218,5 +217,4 @@ int main() { parallel_test_case(test_case_inclusive_scan_bop_init_parallel_associative); parallel_test_case(test_case_inclusive_scan_bop_init_parallel_associative_in_place); test_case_inclusive_scan_init_writes_intermediate_type(); -#endif // _M_CEE } diff --git a/tests/std/tests/P0024R2_parallel_algorithms_mismatch/test.cpp b/tests/std/tests/P0024R2_parallel_algorithms_mismatch/test.cpp index 5d7ffb34717..cac22c3ab70 100644 --- a/tests/std/tests/P0024R2_parallel_algorithms_mismatch/test.cpp +++ b/tests/std/tests/P0024R2_parallel_algorithms_mismatch/test.cpp @@ -77,7 +77,6 @@ void test_case_mismatch_lengths(const size_t testSize) { } int main() { -#ifndef _M_CEE // TRANSITION, VSO-1659489 parallel_test_case(test_case_mismatch_signatures); parallel_test_case(test_case_mismatch_signatures); parallel_test_case(test_case_mismatch_signatures); @@ -86,5 +85,4 @@ int main() { parallel_test_case(test_case_mismatch_lengths); parallel_test_case(test_case_mismatch_lengths); parallel_test_case(test_case_mismatch_lengths); -#endif // _M_CEE } diff --git a/tests/std/tests/P0024R2_parallel_algorithms_reduce/test.cpp b/tests/std/tests/P0024R2_parallel_algorithms_reduce/test.cpp index 21058aa8c61..c168a294f23 100644 --- a/tests/std/tests/P0024R2_parallel_algorithms_reduce/test.cpp +++ b/tests/std/tests/P0024R2_parallel_algorithms_reduce/test.cpp @@ -75,11 +75,9 @@ void test_case_incorrect_special_case_reasoning() { } int main() { -#ifndef _M_CEE // TRANSITION, VSO-1659695 mt19937 gen(1729); parallel_test_case(test_case_reduce, gen); parallel_test_case([](const size_t testSize) { test_case_move_only(seq, testSize); }); parallel_test_case([](const size_t testSize) { test_case_move_only(par, testSize); }); test_case_incorrect_special_case_reasoning(); -#endif // _M_CEE } diff --git a/tests/std/tests/P0024R2_parallel_algorithms_replace/test.cpp b/tests/std/tests/P0024R2_parallel_algorithms_replace/test.cpp index ef153df436e..1a4c38389ab 100644 --- a/tests/std/tests/P0024R2_parallel_algorithms_replace/test.cpp +++ b/tests/std/tests/P0024R2_parallel_algorithms_replace/test.cpp @@ -37,10 +37,8 @@ void test_case_replace_if_parallel(const size_t testSize, mt19937& gen) { } int main() { -#ifndef _M_CEE // TRANSITION, VSO-1659695 mt19937 gen(1729); parallel_test_case(test_case_replace_parallel, gen); parallel_test_case(test_case_replace_if_parallel, gen); -#endif // _M_CEE } diff --git a/tests/std/tests/P0024R2_parallel_algorithms_transform_inclusive_scan/test.cpp b/tests/std/tests/P0024R2_parallel_algorithms_transform_inclusive_scan/test.cpp index 2e6f5f9f509..7608cfc7e63 100644 --- a/tests/std/tests/P0024R2_parallel_algorithms_transform_inclusive_scan/test.cpp +++ b/tests/std/tests/P0024R2_parallel_algorithms_transform_inclusive_scan/test.cpp @@ -218,7 +218,6 @@ void test_case_transform_inclusive_scan_init_writes_intermediate_type() { } int main() { -#ifndef _M_CEE // TRANSITION, VSO-1659695 mt19937 gen(1729); parallel_test_case(test_case_transform_inclusive_scan_parallel, gen); @@ -228,5 +227,4 @@ int main() { parallel_test_case(test_case_transform_inclusive_scan_init_parallel_associative); parallel_test_case(test_case_transform_inclusive_scan_init_parallel_associative_in_place); test_case_transform_inclusive_scan_init_writes_intermediate_type(); -#endif // _M_CEE } diff --git a/tests/std/tests/P0024R2_parallel_algorithms_transform_reduce/test.cpp b/tests/std/tests/P0024R2_parallel_algorithms_transform_reduce/test.cpp index 93dd580991b..91418380195 100644 --- a/tests/std/tests/P0024R2_parallel_algorithms_transform_reduce/test.cpp +++ b/tests/std/tests/P0024R2_parallel_algorithms_transform_reduce/test.cpp @@ -145,7 +145,6 @@ void test_case_incorrect_special_case_reasoning() { } int main() { -#ifndef _M_CEE // TRANSITION, VSO-1659695 mt19937 gen(1729); parallel_test_case(test_case_transform_reduce_binary, gen); parallel_test_case(test_case_transform_reduce, gen); @@ -154,5 +153,4 @@ int main() { parallel_test_case([](const size_t testSize) { test_case_move_only(seq, testSize); }); parallel_test_case([](const size_t testSize) { test_case_move_only(par, testSize); }); test_case_incorrect_special_case_reasoning(); -#endif // _M_CEE } diff --git a/tests/std/tests/P0896R4_ranges_alg_equal/test.cpp b/tests/std/tests/P0896R4_ranges_alg_equal/test.cpp index 3b3487887e6..3080000d0be 100644 --- a/tests/std/tests/P0896R4_ranges_alg_equal/test.cpp +++ b/tests/std/tests/P0896R4_ranges_alg_equal/test.cpp @@ -79,13 +79,11 @@ constexpr void smoke_test() { assert(!equal(begin(arr1), unreachable_sentinel, begin(arr2), end(arr2))); assert(!equal(begin(arr1), end(arr1), begin(arr2), unreachable_sentinel)); } -#ifndef _M_CEE // TRANSITION, VSO-1666180 { // Validate GH-3550: ": ranges::equal does not work for ranges with integer-class range_difference_t" auto v = ranges::subrange{std::views::iota(0ull, 10ull)} | std::views::drop(2); assert(equal(v, v)); } -#endif // _M_CEE } int main() { diff --git a/tests/std/tests/P0896R4_views_drop/test.cpp b/tests/std/tests/P0896R4_views_drop/test.cpp index 571febe097c..c5717cf6340 100644 --- a/tests/std/tests/P0896R4_views_drop/test.cpp +++ b/tests/std/tests/P0896R4_views_drop/test.cpp @@ -559,7 +559,6 @@ int main() { STATIC_ASSERT((instantiation_test(), true)); instantiation_test(); -#ifndef _M_CEE // TRANSITION, VSO-1666180 { // Validate a view borrowed range constexpr auto v = @@ -567,7 +566,6 @@ int main() { STATIC_ASSERT(test_one(v, only_four_ints)); test_one(v, only_four_ints); } -#endif // _M_CEE { // Validate that we can use something that is convertible to integral (GH-1957) constexpr span s{some_ints}; diff --git a/tests/std/tests/P0896R4_views_elements/test.cpp b/tests/std/tests/P0896R4_views_elements/test.cpp index 24ad3092903..76aace15fe0 100644 --- a/tests/std/tests/P0896R4_views_elements/test.cpp +++ b/tests/std/tests/P0896R4_views_elements/test.cpp @@ -438,12 +438,10 @@ int main() { instantiation_test(); } -#ifndef _M_CEE // TRANSITION, VSO-1666180 { // Validate a view borrowed range constexpr auto v = views::iota(0ull, ranges::size(expected_keys)) | views::transform([](auto i) { return make_pair(expected_keys[i], expected_values[i]); }); STATIC_ASSERT(test_one(v)); test_one(v); } -#endif // _M_CEE } diff --git a/tests/std/tests/P0896R4_views_iota/test.cpp b/tests/std/tests/P0896R4_views_iota/test.cpp index a4e530846fc..ee7bdb0ccc5 100644 --- a/tests/std/tests/P0896R4_views_iota/test.cpp +++ b/tests/std/tests/P0896R4_views_iota/test.cpp @@ -314,13 +314,11 @@ constexpr bool test_difference() { } constexpr bool test_gh_3025() { -#ifndef _M_CEE // TRANSITION, VSO-1666180 // GH-3025 : ranges::prev maybe ill-formed in debug mode auto r = views::iota(0ull, 5ull); auto it = r.end(); auto pr = ranges::prev(it, 3); assert(*pr == 2ull); -#endif // _M_CEE return true; } diff --git a/tests/std/tests/P0896R4_views_take/test.cpp b/tests/std/tests/P0896R4_views_take/test.cpp index 8bcca019eee..815beb37ce5 100644 --- a/tests/std/tests/P0896R4_views_take/test.cpp +++ b/tests/std/tests/P0896R4_views_take/test.cpp @@ -671,7 +671,6 @@ int main() { STATIC_ASSERT((instantiation_test(), true)); instantiation_test(); -#ifndef _M_CEE // TRANSITION, VSO-1666180 { // Validate a view borrowed range constexpr auto v = @@ -679,7 +678,6 @@ int main() { STATIC_ASSERT(test_one(v, only_four_ints)); test_one(v, only_four_ints); } -#endif // _M_CEE { // Validate that we can use something that is convertible to integral (GH-1957) constexpr span s{some_ints}; diff --git a/tests/std/tests/P1135R6_atomic_flag_test/test.cpp b/tests/std/tests/P1135R6_atomic_flag_test/test.cpp index 93bc5f720b2..f82dbed3108 100644 --- a/tests/std/tests/P1135R6_atomic_flag_test/test.cpp +++ b/tests/std/tests/P1135R6_atomic_flag_test/test.cpp @@ -82,8 +82,6 @@ void test_flag_type() { } int main() { -#ifndef _M_CEE // TRANSITION, VSO-1659695 test_flag_type(); test_flag_type(); -#endif // _M_CEE } diff --git a/tests/std/tests/P1522R1_difference_type/test.cpp b/tests/std/tests/P1522R1_difference_type/test.cpp index e2a1dc731b8..631f355bb7b 100644 --- a/tests/std/tests/P1522R1_difference_type/test.cpp +++ b/tests/std/tests/P1522R1_difference_type/test.cpp @@ -1293,11 +1293,7 @@ constexpr bool test_cross() { x = -26; TEST(u *= 2, x); y = 12; -#ifdef _M_CEE // TRANSITION, VSO-1658184 (/clr silent bad codegen) - i = 12; -#else // ^^^ workaround / no workaround vvv TEST(i *= -2, y); -#endif // ^^^ no workaround ^^^ x = _Unsigned128{0x55555555'5555554c, 0x55555555'55555555}; TEST(u /= 3, x); // Yes, u is still unsigned =) From d8ed02d2ec7ba8216848a33dec2b5fb385febf4e Mon Sep 17 00:00:00 2001 From: achabense <60953653+achabense@users.noreply.github.com> Date: Fri, 8 Sep 2023 05:39:48 +0800 Subject: [PATCH 19/21] Make `expected` and `expected` copyable (#4013) Co-authored-by: Casey Carter Co-authored-by: Stephan T. Lavavej --- stl/inc/expected | 78 +++++++++------------- tests/std/tests/P0323R12_expected/test.cpp | 5 ++ 2 files changed, 37 insertions(+), 46 deletions(-) diff --git a/stl/inc/expected b/stl/inc/expected index 465a1616e96..12b06882c2f 100644 --- a/stl/inc/expected +++ b/stl/inc/expected @@ -184,12 +184,28 @@ struct _Check_expected_argument : true_type { _EXPORT_STD template class expected { +private: static_assert(_Check_expected_argument<_Ty>::value); static_assert(_Check_unexpected_argument<_Err>::value); template friend class expected; + template + static constexpr bool _Allow_unwrapping = disjunction_v, bool>, + negation&>, // + is_constructible<_Ty, expected<_Uty, _UErr>>, // + is_constructible<_Ty, const expected<_Uty, _UErr>&>, // + is_constructible<_Ty, const expected<_Uty, _UErr>>, // + is_convertible&, _Ty>, // + is_convertible&&, _Ty>, // + is_convertible&, _Ty>, // + is_convertible&&, _Ty>>>> // + && !is_constructible_v, expected<_Uty, _UErr>&> // + && !is_constructible_v, expected<_Uty, _UErr>> // + && !is_constructible_v, const expected<_Uty, _UErr>&> // + && !is_constructible_v, const expected<_Uty, _UErr>>; + public: using value_type = _Ty; using error_type = _Err; @@ -238,23 +254,8 @@ public: // clang-format on template - static constexpr bool _Allow_unwrapping = disjunction_v, bool>, - negation&>, // - is_constructible<_Ty, expected<_Uty, _UErr>>, // - is_constructible<_Ty, const expected<_Uty, _UErr>&>, // - is_constructible<_Ty, const expected<_Uty, _UErr>>, // - is_convertible&, _Ty>, // - is_convertible&&, _Ty>, // - is_convertible&, _Ty>, // - is_convertible&&, _Ty>>>> // - && !is_constructible_v, expected<_Uty, _UErr>&> // - && !is_constructible_v, expected<_Uty, _UErr>> // - && !is_constructible_v, const expected<_Uty, _UErr>&> // - && !is_constructible_v, const expected<_Uty, _UErr>>; - - template - requires is_constructible_v<_Ty, const _Uty&> && is_constructible_v<_Err, const _UErr&> - && _Allow_unwrapping<_Uty, _UErr> + requires _Different_from, expected> && is_constructible_v<_Ty, const _Uty&> + && is_constructible_v<_Err, const _UErr&> && _Allow_unwrapping<_Uty, _UErr> constexpr explicit(!is_convertible_v || !is_convertible_v) expected(const expected<_Uty, _UErr>& _Other) noexcept(is_nothrow_constructible_v<_Ty, const _Uty&> // && is_nothrow_constructible_v<_Err, const _UErr&>) // strengthened @@ -267,7 +268,8 @@ public: } template - requires is_constructible_v<_Ty, _Uty> && is_constructible_v<_Err, _UErr> && _Allow_unwrapping<_Uty, _UErr> + requires _Different_from, expected> && is_constructible_v<_Ty, _Uty> + && is_constructible_v<_Err, _UErr> && _Allow_unwrapping<_Uty, _UErr> constexpr explicit(!is_convertible_v<_Uty, _Ty> || !is_convertible_v<_UErr, _Err>) expected(expected<_Uty, _UErr>&& _Other) noexcept( is_nothrow_constructible_v<_Ty, _Uty>&& is_nothrow_constructible_v<_Err, _UErr>) // strengthened @@ -1161,11 +1163,18 @@ private: template requires is_void_v<_Ty> class expected<_Ty, _Err> { +private: static_assert(_Check_unexpected_argument<_Err>::value); template friend class expected; + template + static constexpr bool _Allow_unwrapping = !is_constructible_v, expected<_Uty, _UErr>&> + && !is_constructible_v, expected<_Uty, _UErr>> + && !is_constructible_v, const expected<_Uty, _UErr>&> + && !is_constructible_v, const expected<_Uty, _UErr>>; + public: using value_type = _Ty; using error_type = _Err; @@ -1202,13 +1211,8 @@ public: // clang-format on template - static constexpr bool _Allow_unwrapping = !is_constructible_v, expected<_Uty, _UErr>&> - && !is_constructible_v, expected<_Uty, _UErr>> - && !is_constructible_v, const expected<_Uty, _UErr>&> - && !is_constructible_v, const expected<_Uty, _UErr>>; - - template - requires is_void_v<_Uty> && is_constructible_v<_Err, const _UErr&> && _Allow_unwrapping<_Uty, _UErr> + requires _Different_from, expected> && is_void_v<_Uty> + && is_constructible_v<_Err, const _UErr&> && _Allow_unwrapping<_Uty, _UErr> constexpr explicit(!is_convertible_v) expected(const expected<_Uty, _UErr>& _Other) noexcept( is_nothrow_constructible_v<_Err, const _UErr&>) // strengthened : _Has_value(_Other._Has_value) { @@ -1218,7 +1222,8 @@ public: } template - requires is_void_v<_Uty> && is_constructible_v<_Err, _UErr> && _Allow_unwrapping<_Uty, _UErr> + requires _Different_from, expected> && is_void_v<_Uty> && is_constructible_v<_Err, _UErr> + && _Allow_unwrapping<_Uty, _UErr> constexpr explicit(!is_convertible_v<_UErr, _Err>) expected(expected<_Uty, _UErr>&& _Other) noexcept(is_nothrow_constructible_v<_Err, _UErr>) // strengthened : _Has_value(_Other._Has_value) { @@ -1380,26 +1385,7 @@ public: is_nothrow_move_constructible_v<_Err>&& is_nothrow_swappable_v<_Err>) requires is_swappable_v<_Err> && is_move_constructible_v<_Err> { - using _STD swap; - if (_Left._Has_value && _Right._Has_value) { - // nothing - } else if (_Left._Has_value) { - _STD construct_at(_STD addressof(_Left._Unexpected), _STD move(_Right._Unexpected)); - if constexpr (!is_trivially_destructible_v<_Err>) { - _Right._Unexpected.~_Err(); - } - _Left._Has_value = false; - _Right._Has_value = true; - } else if (_Right._Has_value) { - _STD construct_at(_STD addressof(_Right._Unexpected), _STD move(_Left._Unexpected)); - if constexpr (!is_trivially_destructible_v<_Err>) { - _Left._Unexpected.~_Err(); - } - _Left._Has_value = true; - _Right._Has_value = false; - } else { - swap(_Left._Unexpected, _Right._Unexpected); // intentional ADL - } + _Left.swap(_Right); } // [expected.void.obs] diff --git a/tests/std/tests/P0323R12_expected/test.cpp b/tests/std/tests/P0323R12_expected/test.cpp index 91214c634fd..5b822c1c57c 100644 --- a/tests/std/tests/P0323R12_expected/test.cpp +++ b/tests/std/tests/P0323R12_expected/test.cpp @@ -3,6 +3,7 @@ #define _CONTAINER_DEBUG_LEVEL 1 +#include #include #include #include @@ -2135,6 +2136,10 @@ void test_lwg_3843() { } } +// Test GH-4011: these predicates triggered constraint recursion. +static_assert(copyable>); +static_assert(copyable>); + int main() { test_unexpected::test_all(); static_assert(test_unexpected::test_all()); From 8dd198ffa6528a3bb3fff015c0c90c056390b8ba Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Fri, 8 Sep 2023 14:44:35 -0700 Subject: [PATCH 20/21] Fix stealth merge conflict with C++20 Standard Library Modules. --- stl/modules/std.ixx | 2 ++ tests/std/include/test_header_units_and_modules.hpp | 4 ++++ .../std/tests/P1502R1_standard_library_header_units/test.cpp | 2 ++ 3 files changed, 8 insertions(+) diff --git a/stl/modules/std.ixx b/stl/modules/std.ixx index 07d18e66b2c..0d094093b5f 100644 --- a/stl/modules/std.ixx +++ b/stl/modules/std.ixx @@ -61,7 +61,9 @@ export module std; #include #endif // _HAS_CXX23 #include +#if _HAS_CXX23 #include +#endif // _HAS_CXX23 #include #include #include diff --git a/tests/std/include/test_header_units_and_modules.hpp b/tests/std/include/test_header_units_and_modules.hpp index 06546ff448c..ce9482aac30 100644 --- a/tests/std/include/test_header_units_and_modules.hpp +++ b/tests/std/include/test_header_units_and_modules.hpp @@ -236,12 +236,14 @@ void test_filesystem() { assert(info.capacity != static_cast(-1)); } +#if TEST_STANDARD >= 23 void test_flat_set() { using namespace std; puts("Testing ."); // FIXME! ADD TEST COVERAGE HERE! } +#endif // TEST_STANDARD >= 23 void test_format() { using namespace std; @@ -1101,7 +1103,9 @@ void all_cpp_header_tests() { test_expected(); #endif // TEST_STANDARD >= 23 test_filesystem(); +#if TEST_STANDARD >= 23 test_flat_set(); +#endif // TEST_STANDARD >= 23 test_format(); test_forward_list(); test_fstream(); diff --git a/tests/std/tests/P1502R1_standard_library_header_units/test.cpp b/tests/std/tests/P1502R1_standard_library_header_units/test.cpp index 9ca66909b06..4362fd8e20f 100644 --- a/tests/std/tests/P1502R1_standard_library_header_units/test.cpp +++ b/tests/std/tests/P1502R1_standard_library_header_units/test.cpp @@ -31,7 +31,9 @@ import ; import ; #endif // TEST_STANDARD >= 23 import ; +#if TEST_STANDARD >= 23 import ; +#endif // TEST_STANDARD >= 23 import ; import ; import ; From 384040a9e1483a22483d1a35592468f0dbf93440 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Fri, 8 Sep 2023 14:49:18 -0700 Subject: [PATCH 21/21] Use 4-arg std::equal(). --- tests/std/tests/P1222R4_flat_set/test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/std/tests/P1222R4_flat_set/test.cpp b/tests/std/tests/P1222R4_flat_set/test.cpp index 7547d6887df..cdbe4b7698f 100644 --- a/tests/std/tests/P1222R4_flat_set/test.cpp +++ b/tests/std/tests/P1222R4_flat_set/test.cpp @@ -97,7 +97,7 @@ void assert_all_requirements_and_equals(const T& s, const initializer_list