From 6aa42e1f70d5ca98ead5d32b826941a00ab0deb7 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Thu, 30 Oct 2025 09:50:23 -0700 Subject: [PATCH 1/6] Remove product code. --- stl/inc/iterator | 407 ----------------------------------------------- 1 file changed, 407 deletions(-) diff --git a/stl/inc/iterator b/stl/inc/iterator index ca074e6c0ec..cce1ee95cf9 100644 --- a/stl/inc/iterator +++ b/stl/inc/iterator @@ -1485,413 +1485,6 @@ struct iterator_traits> : iterator_traits<_Iter> { _STD_END -#pragma push_macro("stdext") -#pragma push_macro("checked_array_iterator") -#pragma push_macro("make_checked_array_iterator") -#pragma push_macro("make_unchecked_array_iterator") -#pragma push_macro("unchecked_array_iterator") -#undef stdext -#undef checked_array_iterator -#undef make_checked_array_iterator -#undef make_unchecked_array_iterator -#undef unchecked_array_iterator - -_STDEXT_BEGIN -template -class _DEPRECATE_STDEXT_ARR_ITERS checked_array_iterator { // wrap a pointer with checking -private: - using _Pointee_type = _STD remove_pointer_t<_Ptr>; - static_assert(_STD is_pointer_v<_Ptr> && _STD is_object_v<_Pointee_type>, - "checked_array_iterator requires pointers to objects"); - -public: - using iterator_category = _STD random_access_iterator_tag; - using value_type = _STD remove_cv_t<_Pointee_type>; - using difference_type = _STD ptrdiff_t; - using pointer = _Ptr; - using reference = _Pointee_type&; -#if _HAS_CXX20 - using iterator_concept = _STD contiguous_iterator_tag; -#endif // _HAS_CXX20 - - constexpr checked_array_iterator() = default; - - constexpr checked_array_iterator(const _Ptr _Array, const size_t _Size, const size_t _Index = 0) noexcept - : _Myarray(_Array), _Mysize(_Size), _Myindex(_Index) { - _STL_VERIFY(_Index <= _Size, "checked_array_iterator construction index out of range"); - } - - _STL_DISABLE_DEPRECATED_WARNING - template , int> = 0> - constexpr operator checked_array_iterator() const noexcept { - return checked_array_iterator{_Myarray, _Mysize, _Myindex}; - } - _STL_RESTORE_DEPRECATED_WARNING - - _NODISCARD constexpr _Ptr base() const noexcept { - return _Myarray + _Myindex; - } - - _NODISCARD constexpr reference operator*() const noexcept { - return *operator->(); - } - - _NODISCARD constexpr pointer operator->() const noexcept { - _STL_VERIFY(_Myarray, "cannot dereference value-initialized or null checked_array_iterator"); - _STL_VERIFY(_Myindex < _Mysize, "cannot dereference end checked_array_iterator"); - return _Myarray + _Myindex; - } - - constexpr checked_array_iterator& operator++() noexcept { - _STL_VERIFY(_Myarray, "cannot increment value-initialized or null checked_array_iterator"); - _STL_VERIFY(_Myindex < _Mysize, "cannot increment checked_array_iterator past end"); - ++_Myindex; - return *this; - } - - constexpr checked_array_iterator operator++(int) noexcept { - checked_array_iterator _Tmp = *this; - ++*this; - return _Tmp; - } - - constexpr checked_array_iterator& operator--() noexcept { - _STL_VERIFY(_Myarray, "cannot decrement value-initialized or null checked_array_iterator"); - _STL_VERIFY(_Myindex != 0, "cannot decrement checked_array_iterator before begin"); - --_Myindex; - return *this; - } - - constexpr checked_array_iterator operator--(int) noexcept { - checked_array_iterator _Tmp = *this; - --*this; - return _Tmp; - } - - constexpr checked_array_iterator& operator+=(const difference_type _Off) noexcept { - if (_Off != 0) { - _STL_VERIFY(_Myarray, "cannot seek value-initialized or null checked_array_iterator"); - } - - if (_Off < 0) { - _STL_VERIFY( - _Myindex >= size_t{0} - static_cast(_Off), "cannot seek checked_array_iterator before begin"); - } - - if (_Off > 0) { - _STL_VERIFY( - _Mysize - _Myindex >= static_cast(_Off), "cannot seek checked_array_iterator after end"); - } - - _Myindex += _Off; - return *this; - } - - _NODISCARD constexpr checked_array_iterator operator+(const difference_type _Off) const noexcept { - checked_array_iterator _Tmp = *this; - _Tmp += _Off; - return _Tmp; - } - - _NODISCARD friend constexpr checked_array_iterator operator+( - const difference_type _Off, const checked_array_iterator<_Ptr>& _Next) noexcept { - return _Next + _Off; - } - - constexpr checked_array_iterator& operator-=(const difference_type _Off) noexcept { - if (_Off != 0) { - _STL_VERIFY(_Myarray, "cannot seek value-initialized or null checked_array_iterator"); - } - - if (_Off > 0) { - _STL_VERIFY(_Myindex >= static_cast(_Off), "cannot seek checked_array_iterator before begin"); - } - - if (_Off < 0) { - _STL_VERIFY(_Mysize - _Myindex >= size_t{0} - static_cast(_Off), - "cannot seek checked_array_iterator after end"); - } - - _Myindex -= _Off; - return *this; - } - - _NODISCARD constexpr checked_array_iterator operator-(const difference_type _Off) const noexcept { - checked_array_iterator _Tmp = *this; - _Tmp -= _Off; - return _Tmp; - } - - _NODISCARD constexpr difference_type operator-(const checked_array_iterator& _Right) const noexcept { - _STL_VERIFY(_Myarray == _Right._Myarray && _Mysize == _Right._Mysize, - "cannot subtract incompatible checked_array_iterators"); - return static_cast(_Myindex - _Right._Myindex); - } - - _NODISCARD constexpr reference operator[](const difference_type _Off) const noexcept { - return *(*this + _Off); - } - - _NODISCARD constexpr bool operator==(const checked_array_iterator& _Right) const noexcept { - _STL_VERIFY(_Myarray == _Right._Myarray && _Mysize == _Right._Mysize, - "cannot compare incompatible checked_array_iterators for equality"); - return _Myindex == _Right._Myindex; - } - -#if _HAS_CXX20 - _NODISCARD constexpr _STD strong_ordering operator<=>(const checked_array_iterator& _Right) const noexcept { - _STL_VERIFY(_Myarray == _Right._Myarray && _Mysize == _Right._Mysize, - "cannot compare incompatible checked_array_iterators"); - return _Myindex <=> _Right._Myindex; - } -#else // ^^^ _HAS_CXX20 / !_HAS_CXX20 vvv - _NODISCARD constexpr bool operator!=(const checked_array_iterator& _Right) const noexcept { - return !(*this == _Right); - } - - _NODISCARD constexpr bool operator<(const checked_array_iterator& _Right) const noexcept { - _STL_VERIFY(_Myarray == _Right._Myarray && _Mysize == _Right._Mysize, - "cannot compare incompatible checked_array_iterators"); - return _Myindex < _Right._Myindex; - } - - _NODISCARD constexpr bool operator>(const checked_array_iterator& _Right) const noexcept { - return _Right < *this; - } - - _NODISCARD constexpr bool operator<=(const checked_array_iterator& _Right) const noexcept { - return !(_Right < *this); - } - - _NODISCARD constexpr bool operator>=(const checked_array_iterator& _Right) const noexcept { - return !(*this < _Right); - } -#endif // ^^^ !_HAS_CXX20 ^^^ - - friend constexpr void _Verify_range( - const checked_array_iterator& _First, const checked_array_iterator& _Last) noexcept { - _STL_VERIFY(_First._Myarray == _Last._Myarray && _First._Mysize == _Last._Mysize, - "mismatching checked_array_iterators"); - _STL_VERIFY(_First._Myindex <= _Last._Myindex, "transposed checked_array_iterator range"); - } - - constexpr void _Verify_offset(const difference_type _Off) const noexcept { - if (_Off < 0) { - _STL_VERIFY(_Myindex >= size_t{0} - static_cast(_Off), - "cannot seek checked_array_iterator iterator before begin"); - } - - if (_Off > 0) { - _STL_VERIFY(_Mysize - _Myindex >= static_cast(_Off), - "cannot seek checked_array_iterator iterator after end"); - } - } - - using _Prevent_inheriting_unwrap = checked_array_iterator; - - _NODISCARD constexpr _Ptr _Unwrapped() const noexcept { - return _Myarray + _Myindex; - } - - constexpr void _Seek_to(_Ptr _It) noexcept { - _Myindex = static_cast(_It - _Myarray); - } - -private: - _Ptr _Myarray = nullptr; // beginning of array - size_t _Mysize = 0; // size of array - size_t _Myindex = 0; // offset into array -}; - -_STL_DISABLE_DEPRECATED_WARNING -template -_DEPRECATE_STDEXT_ARR_ITERS _NODISCARD constexpr checked_array_iterator<_Ptr> make_checked_array_iterator( - const _Ptr _Array, const size_t _Size, const size_t _Index = 0) noexcept { - return checked_array_iterator<_Ptr>(_Array, _Size, _Index); -} -_STL_RESTORE_DEPRECATED_WARNING - -template -class _DEPRECATE_STDEXT_ARR_ITERS unchecked_array_iterator { // wrap a pointer without checking, to silence warnings -private: - using _Pointee_type = _STD remove_pointer_t<_Ptr>; - static_assert(_STD is_pointer_v<_Ptr> && _STD is_object_v<_Pointee_type>, - "unchecked_array_iterator requires pointers to objects"); - -public: - using iterator_category = _STD random_access_iterator_tag; - using value_type = _STD remove_cv_t<_Pointee_type>; - using difference_type = _STD ptrdiff_t; - using pointer = _Ptr; - using reference = _Pointee_type&; -#if _HAS_CXX20 - using iterator_concept = _STD contiguous_iterator_tag; -#endif // _HAS_CXX20 - - constexpr unchecked_array_iterator() = default; - - constexpr explicit unchecked_array_iterator(const _Ptr _Src) noexcept : _Myptr(_Src) {} - - _STL_DISABLE_DEPRECATED_WARNING - template , int> = 0> - constexpr operator unchecked_array_iterator() const noexcept { - return unchecked_array_iterator{_Myptr}; - } - _STL_RESTORE_DEPRECATED_WARNING - - _NODISCARD constexpr _Ptr base() const noexcept { - return _Myptr; - } - - _NODISCARD constexpr reference operator*() const noexcept { - return *_Myptr; - } - - _NODISCARD constexpr pointer operator->() const noexcept { - return _Myptr; - } - - constexpr unchecked_array_iterator& operator++() noexcept { - ++_Myptr; - return *this; - } - - constexpr unchecked_array_iterator operator++(int) noexcept { - unchecked_array_iterator _Tmp = *this; - ++_Myptr; - return _Tmp; - } - - constexpr unchecked_array_iterator& operator--() noexcept { - --_Myptr; - return *this; - } - - constexpr unchecked_array_iterator operator--(int) noexcept { - unchecked_array_iterator _Tmp = *this; - --_Myptr; - return _Tmp; - } - - constexpr unchecked_array_iterator& operator+=(const difference_type _Off) noexcept { - _Myptr += _Off; - return *this; - } - - _NODISCARD constexpr unchecked_array_iterator operator+(const difference_type _Off) const noexcept { - unchecked_array_iterator _Tmp = *this; - _Tmp += _Off; - return _Tmp; - } - - _NODISCARD friend constexpr unchecked_array_iterator operator+( - const difference_type _Off, const unchecked_array_iterator& _Next) noexcept { - return _Next + _Off; - } - - constexpr unchecked_array_iterator& operator-=(const difference_type _Off) noexcept { - return *this += -_Off; - } - - _NODISCARD constexpr unchecked_array_iterator operator-(const difference_type _Off) const noexcept { - unchecked_array_iterator _Tmp = *this; - _Tmp -= _Off; - return _Tmp; - } - - _NODISCARD constexpr difference_type operator-(const unchecked_array_iterator& _Right) const noexcept { - return _Myptr - _Right._Myptr; - } - - _NODISCARD constexpr reference operator[](const difference_type _Off) const noexcept { - return *(*this + _Off); - } - - _NODISCARD constexpr bool operator==(const unchecked_array_iterator& _Right) const noexcept { - return _Myptr == _Right._Myptr; - } - -#if _HAS_CXX20 - _NODISCARD constexpr _STD strong_ordering operator<=>(const unchecked_array_iterator& _Right) const noexcept { - return _Myptr <=> _Right._Myptr; - } -#else // ^^^ _HAS_CXX20 / !_HAS_CXX20 vvv - _NODISCARD constexpr bool operator!=(const unchecked_array_iterator& _Right) const noexcept { - return !(*this == _Right); - } - - _NODISCARD constexpr bool operator<(const unchecked_array_iterator& _Right) const noexcept { - return _Myptr < _Right._Myptr; - } - - _NODISCARD constexpr bool operator>(const unchecked_array_iterator& _Right) const noexcept { - return _Right < *this; - } - - _NODISCARD constexpr bool operator<=(const unchecked_array_iterator& _Right) const noexcept { - return !(_Right < *this); - } - - _NODISCARD constexpr bool operator>=(const unchecked_array_iterator& _Right) const noexcept { - return !(*this < _Right); - } -#endif // ^^^ !_HAS_CXX20 ^^^ - -#if _ITERATOR_DEBUG_LEVEL != 0 - friend constexpr void _Verify_range( - const unchecked_array_iterator _First, const unchecked_array_iterator _Last) noexcept { - _STD _Verify_range(_First._Myptr, _Last._Myptr); - } -#endif // _ITERATOR_DEBUG_LEVEL != 0 - - using _Prevent_inheriting_unwrap = unchecked_array_iterator; - - static constexpr bool _Unwrap_when_unverified = true; - - _NODISCARD constexpr _Ptr _Unwrapped() const noexcept { - return _Myptr; - } - - constexpr void _Seek_to(_Ptr _It) noexcept { - _Myptr = _It; - } - -private: - _Ptr _Myptr = nullptr; // underlying pointer -}; - -_STL_DISABLE_DEPRECATED_WARNING -template -_DEPRECATE_STDEXT_ARR_ITERS _NODISCARD unchecked_array_iterator<_Ptr> make_unchecked_array_iterator( - const _Ptr _It) noexcept { - return unchecked_array_iterator<_Ptr>(_It); -} -_STL_RESTORE_DEPRECATED_WARNING -_STDEXT_END - -#if _HAS_CXX20 -_STD_BEGIN -_STL_DISABLE_DEPRECATED_WARNING -template -struct pointer_traits<_STDEXT checked_array_iterator<_Ty*>> { - using pointer = _STDEXT checked_array_iterator<_Ty*>; - using element_type = _Ty; - using difference_type = ptrdiff_t; - - _NODISCARD static constexpr element_type* to_address(const pointer _Iter) noexcept { - return _Iter._Unwrapped(); - } -}; -_STL_RESTORE_DEPRECATED_WARNING -_STD_END -#endif // _HAS_CXX20 - -#pragma pop_macro("unchecked_array_iterator") -#pragma pop_macro("make_unchecked_array_iterator") -#pragma pop_macro("make_checked_array_iterator") -#pragma pop_macro("checked_array_iterator") -#pragma pop_macro("stdext") - #pragma pop_macro("new") _STL_RESTORE_CLANG_WARNINGS #pragma warning(pop) From 7b27b1a276e6c37db052eb7b1d1df7c3e86ac37e Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Thu, 30 Oct 2025 09:50:42 -0700 Subject: [PATCH 2/6] Tombstone the deprecation warning. --- stl/inc/yvals_core.h | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/stl/inc/yvals_core.h b/stl/inc/yvals_core.h index d607952f066..b208d69ab6b 100644 --- a/stl/inc/yvals_core.h +++ b/stl/inc/yvals_core.h @@ -1471,16 +1471,8 @@ _EMIT_STL_ERROR(STL1004, "C++98 unexpected() is incompatible with C++23 unexpect #define _CXX23_DEPRECATE_DENORM #endif // ^^^ warning disabled ^^^ -#if !defined(_SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING) && !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_MS_EXT_DEPRECATION_WARNINGS to suppress this warning.")]] -#else // ^^^ warning enabled / warning disabled vvv -#define _DEPRECATE_STDEXT_ARR_ITERS -#endif // ^^^ warning disabled ^^^ +// STL4043 was "stdext::checked_array_iterator, stdext::unchecked_array_iterator, +// and related factory functions are non-Standard extensions and will be removed" // STL4044 was "The contents of the stdext::cvt namespace are non-Standard extensions and will be removed" From 0c089dcbeeb8e22711d9b75d759c668530d0870c Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Thu, 30 Oct 2025 09:49:27 -0700 Subject: [PATCH 3/6] Delete entire tests. --- tests/std/test.lst | 2 - .../env.lst | 4 - .../test.cpp | 416 ------------------ .../env.lst | 4 - .../test.cpp | 205 --------- 5 files changed, 631 deletions(-) delete mode 100644 tests/std/tests/Dev10_709166_checked_and_unchecked_array_iterator/env.lst delete mode 100644 tests/std/tests/Dev10_709166_checked_and_unchecked_array_iterator/test.cpp delete mode 100644 tests/std/tests/VSO_0299624_checked_array_iterator_idl/env.lst delete mode 100644 tests/std/tests/VSO_0299624_checked_array_iterator_idl/test.cpp diff --git a/tests/std/test.lst b/tests/std/test.lst index 3d13fe2431b..b4f39cbe73e 100644 --- a/tests/std/test.lst +++ b/tests/std/test.lst @@ -69,7 +69,6 @@ tests\Dev10_654977_655012_shared_ptr_move tests\Dev10_661739_tuple_copy_ctors tests\Dev10_682964_stable_sort_warnings tests\Dev10_689595_back_inserter_vector_bool -tests\Dev10_709166_checked_and_unchecked_array_iterator tests\Dev10_709168_marking_iterators_as_checked tests\Dev10_722102_shared_ptr_nullptr tests\Dev10_729003_bind_reference_wrapper @@ -785,7 +784,6 @@ tests\VSO_0204655_heap_algorithms_integer_overflow tests\VSO_0224478_scoped_allocator tests\VSO_0226079_mutex tests\VSO_0234888_num_get_overflows -tests\VSO_0299624_checked_array_iterator_idl tests\VSO_0397980_codecvt_length tests\VSO_0429900_fast_debug_range_based_for tests\VSO_0474901_shift_jis_codecvt diff --git a/tests/std/tests/Dev10_709166_checked_and_unchecked_array_iterator/env.lst b/tests/std/tests/Dev10_709166_checked_and_unchecked_array_iterator/env.lst deleted file mode 100644 index 19f025bd0e6..00000000000 --- a/tests/std/tests/Dev10_709166_checked_and_unchecked_array_iterator/env.lst +++ /dev/null @@ -1,4 +0,0 @@ -# Copyright (c) Microsoft Corporation. -# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception - -RUNALL_INCLUDE ..\usual_matrix.lst diff --git a/tests/std/tests/Dev10_709166_checked_and_unchecked_array_iterator/test.cpp b/tests/std/tests/Dev10_709166_checked_and_unchecked_array_iterator/test.cpp deleted file mode 100644 index a84ae56e1d6..00000000000 --- a/tests/std/tests/Dev10_709166_checked_and_unchecked_array_iterator/test.cpp +++ /dev/null @@ -1,416 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception - -#define _SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define STATIC_ASSERT(...) static_assert(__VA_ARGS__, #__VA_ARGS__) - -template -void check_checked_array_iterator_category_and_convertibility() { - STATIC_ASSERT(std::is_same_v::iterator_category, - std::random_access_iterator_tag>); - - STATIC_ASSERT(std::is_same_v::value_type, std::remove_cv_t>); - - STATIC_ASSERT(std::is_same_v::difference_type, std::ptrdiff_t>); - - STATIC_ASSERT(std::is_same_v::pointer, T*>); - - STATIC_ASSERT(std::is_same_v::reference, T&>); - - STATIC_ASSERT(std::is_convertible_v, stdext::checked_array_iterator>); - -#if _HAS_CXX20 - STATIC_ASSERT( - std::is_same_v::iterator_concept, std::contiguous_iterator_tag>); - - STATIC_ASSERT(std::contiguous_iterator>); -#endif // _HAS_CXX20 -} - -template -void check_unchecked_array_iterator_category_and_convertibility() { - STATIC_ASSERT(std::is_same_v::iterator_category, - std::random_access_iterator_tag>); - - STATIC_ASSERT(std::is_same_v::value_type, std::remove_cv_t>); - - STATIC_ASSERT(std::is_same_v::difference_type, std::ptrdiff_t>); - - STATIC_ASSERT(std::is_same_v::pointer, T*>); - - STATIC_ASSERT(std::is_same_v::reference, T&>); - - STATIC_ASSERT( - std::is_convertible_v, stdext::unchecked_array_iterator>); - -#if _HAS_CXX20 - STATIC_ASSERT( - std::is_same_v::iterator_concept, std::contiguous_iterator_tag>); - - STATIC_ASSERT(std::contiguous_iterator>); -#endif // _HAS_CXX20 -} - -int main() { - { - check_checked_array_iterator_category_and_convertibility(); - check_checked_array_iterator_category_and_convertibility(); - check_checked_array_iterator_category_and_convertibility>(); - - - int* const p = new int[9]; - - for (int i = 0; i < 9; ++i) { - p[i] = (i + 1) * 11; - } - - - auto cat = stdext::make_checked_array_iterator(p, 9); - - STATIC_ASSERT(std::is_same_v>); - -#if _HAS_CXX20 - assert(std::to_address(cat) == &*cat); - assert(std::to_address(cat + 8) == &*cat + 8); - assert(std::to_address(cat + 8) == std::to_address(cat) + 8); - assert(std::to_address(cat + 9) == std::to_address(cat) + 9); -#endif // _HAS_CXX20 - - - auto dog = stdext::make_checked_array_iterator(p, 9, 3); - - STATIC_ASSERT(std::is_same_v>); - -#if _HAS_CXX20 - assert(std::to_address(dog) == &*dog); - assert(std::to_address(dog + 5) == &*dog + 5); - assert(std::to_address(dog + 5) == std::to_address(dog) + 5); - assert(std::to_address(dog - 3) == &*dog - 3); - assert(std::to_address(dog - 3) == std::to_address(dog) - 3); - assert(std::to_address(dog + 6) == std::to_address(dog) + 6); -#endif // _HAS_CXX20 - - - { - stdext::checked_array_iterator zero_arg; - (void) zero_arg; - stdext::checked_array_iterator two_arg(p, 9); - stdext::checked_array_iterator three_arg(p, 9, 3); - } - - - assert(cat.base() == p); - assert(dog.base() == p + 3); - - - assert(*p == 11 && *cat == 11); - *cat = 1729; - assert(*p == 1729 && *cat == 1729); - *cat = 11; - assert(*p == 11 && *cat == 11); - - assert(p[3] == 44 && *dog == 44); - *dog = 1729; - assert(p[3] == 1729 && *dog == 1729); - *dog = 44; - assert(p[3] == 44 && *dog == 44); - - - assert(p[5] == 66 && cat[5] == 66); - cat[5] = 5678; - assert(p[5] == 5678 && cat[5] == 5678); - cat[5] = 66; - assert(p[5] == 66 && cat[5] == 66); - - - { - std::pair* const q = new std::pair[3]; - - q[0] = std::make_pair(100, 200); - q[1] = std::make_pair(300, 400); - q[2] = std::make_pair(500, 600); - - auto iter = stdext::make_checked_array_iterator(q, 3); - - assert(q->second == 200 && iter->second == 200); - iter->second = 1234; - assert(q->second == 1234 && iter->second == 1234); - iter->second = 200; - assert(q->second == 200 && iter->second == 200); - - delete[] q; - } - - - assert(!(cat == dog)); - assert(!(dog == cat)); - assert(cat == cat); - assert(dog == dog); - - assert(cat != dog); - assert(dog != cat); - assert(!(cat != cat)); - assert(!(dog != dog)); - - assert(cat < dog); - assert(!(dog < cat)); - assert(!(cat < cat)); - assert(!(dog < dog)); - - assert(!(cat > dog)); - assert(dog > cat); - assert(!(cat > cat)); - assert(!(dog > dog)); - - assert(cat <= dog); - assert(!(dog <= cat)); - assert(cat <= cat); - assert(dog <= dog); - - assert(!(cat >= dog)); - assert(dog >= cat); - assert(cat >= cat); - assert(dog >= dog); - - - assert(cat + 3 == dog); - assert(3 + cat == dog); - - assert(dog - 3 == cat); - - assert(dog - cat == 3); - assert(cat - dog == -3); - - - cat += 6; - assert(*cat == 77); - cat += -6; - assert(*cat == 11); - - dog -= 2; - assert(*dog == 22); - dog -= -2; - assert(*dog == 44); - - - ++cat; - assert(*cat == 22); - --cat; - assert(*cat == 11); - - - auto tiger = cat++; - assert(*tiger == 11); - assert(*cat == 22); - auto kitten = cat--; - assert(*kitten == 22); - assert(*cat == 11); - - - auto dupe = dog; - assert(*dupe == 44); - dupe = cat; - assert(*dupe == 11); - - - std::vector v(9); - - for (int i = 0; i < 9; ++i) { - v[static_cast(i)] = 1000 + i; - } - - std::copy(v.begin(), v.end(), cat); - - assert(*p == 1000); - assert(p[5] == 1005); - assert(p[8] == 1008); - - delete[] p; - } - - { - check_unchecked_array_iterator_category_and_convertibility(); - check_unchecked_array_iterator_category_and_convertibility(); - check_unchecked_array_iterator_category_and_convertibility>(); - - - int* const p = new int[9]; - - for (int i = 0; i < 9; ++i) { - p[i] = (i + 1) * 11; - } - - - auto cat = stdext::make_unchecked_array_iterator(p); - - STATIC_ASSERT(std::is_same_v>); - -#if _HAS_CXX20 - assert(std::to_address(cat) == &*cat); - assert(std::to_address(cat + 8) == &*cat + 8); - assert(std::to_address(cat + 8) == std::to_address(cat) + 8); - assert(std::to_address(cat + 9) == std::to_address(cat) + 9); -#endif // _HAS_CXX20 - - - auto dog = stdext::make_unchecked_array_iterator(p + 3); - - STATIC_ASSERT(std::is_same_v>); - -#if _HAS_CXX20 - assert(std::to_address(dog) == &*dog); - assert(std::to_address(dog + 5) == &*dog + 5); - assert(std::to_address(dog + 5) == std::to_address(dog) + 5); - assert(std::to_address(dog - 3) == &*dog - 3); - assert(std::to_address(dog - 3) == std::to_address(dog) - 3); - assert(std::to_address(dog + 6) == std::to_address(dog) + 6); -#endif // _HAS_CXX20 - - - { - stdext::unchecked_array_iterator zero_arg; - (void) zero_arg; - stdext::unchecked_array_iterator one_arg(p); - } - - - assert(cat.base() == p); - assert(dog.base() == p + 3); - - - assert(*p == 11 && *cat == 11); - *cat = 1729; - assert(*p == 1729 && *cat == 1729); - *cat = 11; - assert(*p == 11 && *cat == 11); - - assert(p[3] == 44 && *dog == 44); - *dog = 1729; - assert(p[3] == 1729 && *dog == 1729); - *dog = 44; - assert(p[3] == 44 && *dog == 44); - - - assert(p[5] == 66 && cat[5] == 66); - cat[5] = 5678; - assert(p[5] == 5678 && cat[5] == 5678); - cat[5] = 66; - assert(p[5] == 66 && cat[5] == 66); - - - { - std::pair* const q = new std::pair[3]; - - q[0] = std::make_pair(100, 200); - q[1] = std::make_pair(300, 400); - q[2] = std::make_pair(500, 600); - - auto iter = stdext::make_unchecked_array_iterator(q); - - assert(q->second == 200 && iter->second == 200); - iter->second = 1234; - assert(q->second == 1234 && iter->second == 1234); - iter->second = 200; - assert(q->second == 200 && iter->second == 200); - - delete[] q; - } - - - assert(!(cat == dog)); - assert(!(dog == cat)); - assert(cat == cat); - assert(dog == dog); - - assert(cat != dog); - assert(dog != cat); - assert(!(cat != cat)); - assert(!(dog != dog)); - - assert(cat < dog); - assert(!(dog < cat)); - assert(!(cat < cat)); - assert(!(dog < dog)); - - assert(!(cat > dog)); - assert(dog > cat); - assert(!(cat > cat)); - assert(!(dog > dog)); - - assert(cat <= dog); - assert(!(dog <= cat)); - assert(cat <= cat); - assert(dog <= dog); - - assert(!(cat >= dog)); - assert(dog >= cat); - assert(cat >= cat); - assert(dog >= dog); - - - assert(cat + 3 == dog); - assert(3 + cat == dog); - - assert(dog - 3 == cat); - - assert(dog - cat == 3); - assert(cat - dog == -3); - - - cat += 6; - assert(*cat == 77); - cat += -6; - assert(*cat == 11); - - dog -= 2; - assert(*dog == 22); - dog -= -2; - assert(*dog == 44); - - - ++cat; - assert(*cat == 22); - --cat; - assert(*cat == 11); - - - auto tiger = cat++; - assert(*tiger == 11); - assert(*cat == 22); - auto kitten = cat--; - assert(*kitten == 22); - assert(*cat == 11); - - - auto dupe = dog; - assert(*dupe == 44); - dupe = cat; - assert(*dupe == 11); - - - std::vector v(9); - - for (int i = 0; i < 9; ++i) { - v[static_cast(i)] = 1000 + i; - } - - std::copy(v.begin(), v.end(), cat); - - assert(*p == 1000); - assert(p[5] == 1005); - assert(p[8] == 1008); - - delete[] p; - } -} diff --git a/tests/std/tests/VSO_0299624_checked_array_iterator_idl/env.lst b/tests/std/tests/VSO_0299624_checked_array_iterator_idl/env.lst deleted file mode 100644 index 19f025bd0e6..00000000000 --- a/tests/std/tests/VSO_0299624_checked_array_iterator_idl/env.lst +++ /dev/null @@ -1,4 +0,0 @@ -# Copyright (c) Microsoft Corporation. -# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception - -RUNALL_INCLUDE ..\usual_matrix.lst diff --git a/tests/std/tests/VSO_0299624_checked_array_iterator_idl/test.cpp b/tests/std/tests/VSO_0299624_checked_array_iterator_idl/test.cpp deleted file mode 100644 index f5da03d2735..00000000000 --- a/tests/std/tests/VSO_0299624_checked_array_iterator_idl/test.cpp +++ /dev/null @@ -1,205 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception - -#define _SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING - -#include -#include - -#include - -using namespace stdext; - -void test_case_construction_out_of_range() { - checked_array_iterator it(nullptr, 1, 0); // checked_array_iterator construction index out of range - (void) it; -} - -void test_case_operator_dereference_value_initialized_iterator() { - checked_array_iterator it; // note: for IDL to work correctly, default init and value init are equivalent - (void) *it; // cannot dereference value-initialized or null checked_array_iterator -} - -void test_case_operator_dereference_end_iterator() { - int arr[] = {1, 2}; - checked_array_iterator it(arr, 2, 2); - (void) *it; // cannot dereference end checked_array_iterator -} - -void test_case_operator_arrow_value_initialized_iterator() { - checked_array_iterator it; - (void) it.operator->(); // cannot dereference value-initialized or null checked_array_iterator -} - -void test_case_operator_arrow_end_iterator() { - int arr[] = {1, 2}; - checked_array_iterator it(arr, 2, 2); - (void) it.operator->(); // cannot dereference end checked_array_iterator -} - -void test_case_operator_preincrement_value_initialized_iterator() { - checked_array_iterator it; - ++it; // cannot increment value-initialized or null checked_array_iterator -} - -void test_case_operator_preincrement_off_end() { - int arr[] = {1, 2}; - checked_array_iterator it(arr, 2); - for (size_t idx = 0; idx < 3; ++idx) { - ++it; // cannot increment checked_array_iterator past end - } -} - -void test_case_operator_predecrement_value_initialized_iterator() { - checked_array_iterator it; - --it; // cannot decrement value-initialized or null checked_array_iterator -} - -void test_case_operator_predecrement_before_begin() { - int arr[] = {1, 2}; - checked_array_iterator it(arr, 2); - --it; // cannot decrement checked_array_iterator before begin -} - -void test_case_operator_advance_value_initialized_iterator() { - checked_array_iterator it; - it += 1; // cannot seek value-initialized or null checked_array_iterator -} - -void test_case_operator_advance_value_initialized_iterator_zero() { - checked_array_iterator it; - it += 0; // OK -} - -void test_case_operator_advance_before_begin() { - int arr[] = {1, 2}; - checked_array_iterator it(arr, 2); - it += -1; // cannot seek checked_array_iterator before begin -} - -void test_case_operator_advance_after_end() { - int arr[] = {1, 2}; - checked_array_iterator it(arr, 2); - it += 3; // cannot seek checked_array_iterator after end -} - -void test_case_operator_retreat_value_initialized_iterator() { - checked_array_iterator it; - it -= 1; // cannot seek value-initialized or null checked_array_iterator -} - -void test_case_operator_retreat_value_initialized_iterator_zero() { - checked_array_iterator it; - it -= 0; // OK -} - -void test_case_operator_retreat_before_begin() { - int arr[] = {1, 2}; - checked_array_iterator it(arr, 2); - it -= 1; // cannot seek checked_array_iterator before begin -} - -void test_case_operator_retreat_after_end() { - int arr[] = {1, 2}; - checked_array_iterator it(arr, 2); - it -= -3; // cannot seek checked_array_iterator after end -} - -void test_case_operator_subtract_incompatible_different_arrays() { - int arr1[] = {1, 2}; - checked_array_iterator it1(arr1, 2); - int arr2[] = {3, 4}; - checked_array_iterator it2(arr2, 2); - (void) (it1 - it2); // cannot subtract incompatible checked_array_iterators -} - -void test_case_operator_subtract_incompatible_different_sizes() { - int arr[] = {1, 2, 3}; - checked_array_iterator it1(arr, 2); - checked_array_iterator it2(arr, 3); - (void) (it1 - it2); // cannot subtract incompatible checked_array_iterators -} - -void test_case_operator_subtract_incompatible_value_initialized() { - int arr[] = {1, 2}; - checked_array_iterator it(arr, 2); - (void) (it - checked_array_iterator{}); // cannot subtract incompatible checked_array_iterators -} - -void test_case_operator_equal_incompatible_different_arrays() { - int arr1[] = {1, 2}; - checked_array_iterator it1(arr1, 2); - int arr2[] = {3, 4}; - checked_array_iterator it2(arr2, 2); - (void) (it1 == it2); // cannot compare incompatible checked_array_iterators for equality -} - -void test_case_operator_equal_incompatible_different_sizes() { - int arr[] = {1, 2, 3}; - checked_array_iterator it1(arr, 2); - checked_array_iterator it2(arr, 3); - (void) (it1 == it2); // cannot compare incompatible checked_array_iterators for equality -} - -void test_case_operator_equal_incompatible_value_initialized() { - int arr[] = {1, 2}; - checked_array_iterator it(arr, 2); - (void) (it == checked_array_iterator{}); // cannot compare incompatible checked_array_iterators for equality -} - -void test_case_operator_less_incompatible_different_arrays() { - int arr1[] = {1, 2}; - checked_array_iterator it1(arr1, 2); - int arr2[] = {3, 4}; - checked_array_iterator it2(arr2, 2); - (void) (it1 < it2); // cannot compare incompatible checked_array_iterators -} - -void test_case_operator_less_incompatible_different_sizes() { - int arr[] = {1, 2, 3}; - checked_array_iterator it1(arr, 2); - checked_array_iterator it2(arr, 3); - (void) (it1 < it2); // cannot compare incompatible checked_array_iterators -} - -void test_case_operator_less_incompatible_value_initialized() { - int arr[] = {1, 2}; - checked_array_iterator it(arr, 2); - (void) (it < checked_array_iterator{}); // cannot compare incompatible checked_array_iterators -} - -// Note: checked_array_iterator checks are enabled even for _ITERATOR_DEBUG_LEVEL==0 -int main(int argc, char* argv[]) { - std_testing::death_test_executive exec([] { - test_case_operator_advance_value_initialized_iterator_zero(); - test_case_operator_retreat_value_initialized_iterator_zero(); - }); - - exec.add_death_tests({ - test_case_operator_dereference_value_initialized_iterator, - test_case_operator_dereference_end_iterator, - test_case_operator_arrow_value_initialized_iterator, - test_case_operator_arrow_end_iterator, - test_case_operator_preincrement_value_initialized_iterator, - test_case_operator_preincrement_off_end, - test_case_operator_predecrement_value_initialized_iterator, - test_case_operator_predecrement_before_begin, - test_case_operator_advance_value_initialized_iterator, - test_case_operator_advance_before_begin, - test_case_operator_advance_after_end, - test_case_operator_retreat_value_initialized_iterator, - test_case_operator_retreat_before_begin, - test_case_operator_retreat_after_end, - test_case_operator_subtract_incompatible_different_arrays, - test_case_operator_subtract_incompatible_different_sizes, - test_case_operator_subtract_incompatible_value_initialized, - test_case_operator_equal_incompatible_different_arrays, - test_case_operator_equal_incompatible_different_sizes, - test_case_operator_equal_incompatible_value_initialized, - test_case_operator_less_incompatible_different_arrays, - test_case_operator_less_incompatible_different_sizes, - test_case_operator_less_incompatible_value_initialized, - }); - - return exec.run(argc, argv); -} From 116411a711dc5447d24728c1910b01871cfb8222 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Thu, 30 Oct 2025 09:52:42 -0700 Subject: [PATCH 4/6] Remove test coverage. --- .../test.cpp | 5 --- .../test.compile.pass.cpp | 26 --------------- .../test.cpp | 4 --- tests/std/tests/P1614R2_spaceship/test.cpp | 32 ------------------- .../test.compile.pass.cpp | 19 ----------- 5 files changed, 86 deletions(-) diff --git a/tests/std/tests/Dev10_500860_overloaded_address_of/test.cpp b/tests/std/tests/Dev10_500860_overloaded_address_of/test.cpp index 3b86c79936b..cb00f989db1 100644 --- a/tests/std/tests/Dev10_500860_overloaded_address_of/test.cpp +++ b/tests/std/tests/Dev10_500860_overloaded_address_of/test.cpp @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#define _SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING - #include #include #include @@ -30,7 +28,6 @@ #include using namespace std; -using namespace stdext; #define STATIC_ASSERT(...) static_assert(__VA_ARGS__, #__VA_ARGS__) @@ -164,8 +161,6 @@ template class std::_List_unchecked_const_iterator<_List_val<_List_simple_types< template class std::reverse_iterator; template class std::move_iterator; template class std::istream_iterator; -template class stdext::checked_array_iterator; -template class stdext::unchecked_array_iterator; template class std::shared_ptr; diff --git a/tests/std/tests/Dev10_709168_marking_iterators_as_checked/test.compile.pass.cpp b/tests/std/tests/Dev10_709168_marking_iterators_as_checked/test.compile.pass.cpp index 754b6a632f2..4a4b9435c9a 100644 --- a/tests/std/tests/Dev10_709168_marking_iterators_as_checked/test.compile.pass.cpp +++ b/tests/std/tests/Dev10_709168_marking_iterators_as_checked/test.compile.pass.cpp @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#define _SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING - #include #include #include @@ -111,9 +109,6 @@ STATIC_ASSERT(stl_checked == _Range_verifiable_v::iterator>); STATIC_ASSERT(stl_checked == _Range_verifiable_v::reverse_iterator>); #endif // _HAS_CXX20 -STATIC_ASSERT(_Range_verifiable_v>); -STATIC_ASSERT(stl_checked == _Range_verifiable_v>); - STATIC_ASSERT(!_Range_verifiable_v<::DerivedFrom>); STATIC_ASSERT(!_Range_verifiable_v<::DerivedFrom>); STATIC_ASSERT(!_Range_verifiable_v<::DerivedFrom>); @@ -186,9 +181,6 @@ STATIC_ASSERT(!_Range_verifiable_v<::DerivedFrom::iterator>>); STATIC_ASSERT(!_Range_verifiable_v<::DerivedFrom::reverse_iterator>>); #endif // _HAS_CXX20 -STATIC_ASSERT(!_Range_verifiable_v<::DerivedFrom>>); -STATIC_ASSERT(!_Range_verifiable_v<::DerivedFrom>>); - template constexpr bool test_unwrappable() { STATIC_ASSERT(_Unwrappable_v == Expected); @@ -402,9 +394,6 @@ STATIC_ASSERT(test_unwrappable_for_unverified::iterator, !stl_checked> STATIC_ASSERT(test_unwrappable_for_unverified::reverse_iterator, !stl_checked>()); #endif // _HAS_CXX20 -STATIC_ASSERT(test_unwrappable_for_unverified, false>()); -STATIC_ASSERT(test_unwrappable_for_unverified, true>()); - STATIC_ASSERT(test_unwrappable()); STATIC_ASSERT(test_unwrappable()); STATIC_ASSERT(test_unwrappable()); @@ -478,9 +467,6 @@ STATIC_ASSERT(test_unwrappable::iterator, true>()); STATIC_ASSERT(test_unwrappable::reverse_iterator, true>()); #endif // _HAS_CXX20 -STATIC_ASSERT(test_unwrappable, true>()); -STATIC_ASSERT(test_unwrappable, true>()); - STATIC_ASSERT(test_unwrappable_for_offset()); STATIC_ASSERT(test_unwrappable_for_offset()); STATIC_ASSERT(test_unwrappable_for_offset()); @@ -554,9 +540,6 @@ STATIC_ASSERT(test_unwrappable_for_offset::iterator, true>()); STATIC_ASSERT(test_unwrappable_for_offset::reverse_iterator, true>()); #endif // _HAS_CXX20 -STATIC_ASSERT(test_unwrappable_for_offset, true>()); -STATIC_ASSERT(test_unwrappable_for_offset, false>()); - STATIC_ASSERT(test_unwrappable_for_unverified<::DerivedFrom, false>()); STATIC_ASSERT(test_unwrappable_for_unverified<::DerivedFrom, false>()); STATIC_ASSERT(test_unwrappable_for_unverified<::DerivedFrom, false>()); @@ -629,9 +612,6 @@ STATIC_ASSERT(test_unwrappable_for_unverified<::DerivedFrom::iterator> STATIC_ASSERT(test_unwrappable_for_unverified<::DerivedFrom::reverse_iterator>, false>()); #endif // _HAS_CXX20 -STATIC_ASSERT(test_unwrappable_for_unverified<::DerivedFrom>, false>()); -STATIC_ASSERT(test_unwrappable_for_unverified<::DerivedFrom>, false>()); - STATIC_ASSERT(test_unwrappable<::DerivedFrom, false>()); STATIC_ASSERT(test_unwrappable<::DerivedFrom, false>()); STATIC_ASSERT(test_unwrappable<::DerivedFrom, false>()); @@ -704,9 +684,6 @@ STATIC_ASSERT(test_unwrappable<::DerivedFrom::iterator>, false>()); STATIC_ASSERT(test_unwrappable<::DerivedFrom::reverse_iterator>, false>()); #endif // _HAS_CXX20 -STATIC_ASSERT(test_unwrappable<::DerivedFrom>, false>()); -STATIC_ASSERT(test_unwrappable<::DerivedFrom>, false>()); - STATIC_ASSERT(test_unwrappable_for_offset<::DerivedFrom, false>()); STATIC_ASSERT(test_unwrappable_for_offset<::DerivedFrom, false>()); STATIC_ASSERT(test_unwrappable_for_offset<::DerivedFrom, false>()); @@ -778,6 +755,3 @@ STATIC_ASSERT(test_unwrappable_for_offset<::DerivedFrom::iterator>, false>()); STATIC_ASSERT(test_unwrappable_for_offset<::DerivedFrom::reverse_iterator>, false>()); #endif // _HAS_CXX20 - -STATIC_ASSERT(test_unwrappable_for_offset<::DerivedFrom>, false>()); -STATIC_ASSERT(test_unwrappable_for_offset<::DerivedFrom>, false>()); diff --git a/tests/std/tests/Dev11_0000000_null_forward_iterators/test.cpp b/tests/std/tests/Dev11_0000000_null_forward_iterators/test.cpp index 60ba4716aeb..4e09d136a00 100644 --- a/tests/std/tests/Dev11_0000000_null_forward_iterators/test.cpp +++ b/tests/std/tests/Dev11_0000000_null_forward_iterators/test.cpp @@ -2,7 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING -#define _SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING #include #include @@ -190,9 +189,6 @@ int main() { test_iterator(); #endif // _HAS_CXX17 - test_iterator>(); - test_iterator>(); - { // Also test string iterator subtraction. diff --git a/tests/std/tests/P1614R2_spaceship/test.cpp b/tests/std/tests/P1614R2_spaceship/test.cpp index d333dcfbeef..649e9868c6c 100644 --- a/tests/std/tests/P1614R2_spaceship/test.cpp +++ b/tests/std/tests/P1614R2_spaceship/test.cpp @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#define _SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING - #include #include #include @@ -604,36 +602,6 @@ void ordering_test_cases() { std::stack b{std::deque{10, 20, 40}}; ordered_containers_test(a, a, b); } - { // checked_array_iterator - int arr[] = {11, 22, 33}; - constexpr auto N = std::size(arr); - - using I = stdext::checked_array_iterator; - using CI = stdext::checked_array_iterator; // TRANSITION, GH-943, should be - - I first{arr, N}; - I last{arr, N, N}; - - CI cfirst{arr, N}; - CI clast{arr, N, N}; - - ordered_iterator_test(first, first, last, cfirst, cfirst, clast); - } - { // unchecked_array_iterator - int arr[] = {11, 22, 33}; - constexpr auto N = std::size(arr); - - using I = stdext::unchecked_array_iterator; - using CI = stdext::unchecked_array_iterator; // TRANSITION, GH-943, should be - - I first{arr}; - I last{arr + N}; - - CI cfirst{arr}; - CI clast{arr + N}; - - ordered_iterator_test(first, first, last, cfirst, cfirst, clast); - } { // sub_match const std::string s1{"cats"}; const std::string s2{"meow"}; diff --git a/tests/std/tests/VSO_0000000_instantiate_iterators_misc/test.compile.pass.cpp b/tests/std/tests/VSO_0000000_instantiate_iterators_misc/test.compile.pass.cpp index b7af121ca76..a59a6ad78df 100644 --- a/tests/std/tests/VSO_0000000_instantiate_iterators_misc/test.compile.pass.cpp +++ b/tests/std/tests/VSO_0000000_instantiate_iterators_misc/test.compile.pass.cpp @@ -19,7 +19,6 @@ #define _SILENCE_CXX20_U8PATH_DEPRECATION_WARNING #define _SILENCE_CXX20_VOLATILE_DEPRECATION_WARNING #define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING -#define _SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING #define _USE_NAMED_IDL_NAMESPACE 1 #include @@ -715,22 +714,6 @@ void nonmember_iterator_functions_test() { (void) cend(c); } -void msvc_array_iterators_test() { - using namespace stdext; - int arr[] = {1, 2, 3, 4}; - - auto unchecked = make_unchecked_array_iterator(arr); - auto checked = make_checked_array_iterator(arr, size(arr)); - - random_access_iterator_test(unchecked); - random_access_iterator_test(checked); - - swap_test(unchecked); - swap_test(checked); - comparable_test(unchecked); - comparable_test(checked); -} - void iterators_test() { fwd_iterators_test>(); fwd_iterators_test>(); @@ -750,8 +733,6 @@ void iterators_test() { nonmember_reverse_iterator_functions_test>(); nonmember_reverse_iterator_functions_test>(); - msvc_array_iterators_test(); - int arr[] = {1}; initializer_list il = {2}; forward_list flist{3}; From a949d0eb9436ed7dfc465775d77e30e692935dab Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Thu, 30 Oct 2025 09:52:57 -0700 Subject: [PATCH 5/6] Ensure that we never mention these names again. --- .../test.compile.pass.cpp | 26 ++++--------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/tests/std/tests/GH_002206_unreserved_names/test.compile.pass.cpp b/tests/std/tests/GH_002206_unreserved_names/test.compile.pass.cpp index 2600ea8f442..eadd271f797 100644 --- a/tests/std/tests/GH_002206_unreserved_names/test.compile.pass.cpp +++ b/tests/std/tests/GH_002206_unreserved_names/test.compile.pass.cpp @@ -16,6 +16,11 @@ #define uniform_int delete #define uniform_real delete +#define checked_array_iterator delete +#define make_checked_array_iterator delete +#define make_unchecked_array_iterator delete +#define unchecked_array_iterator delete + // Test workaround for extensions of non-reserved names that can't be removed at this moment. #define raw_name 1001 @@ -25,11 +30,6 @@ #define opfx 1004 #define osfx 1005 -#define checked_array_iterator 1006 -#define make_checked_array_iterator 1007 -#define make_unchecked_array_iterator 1008 -#define unchecked_array_iterator 1009 - // Also test GH-2645: : Conformance issue on [[msvc::known_semantics]] #define msvc 1 #define known_semantics 2 @@ -88,19 +88,3 @@ #if osfx != 1005 #error bad macro expansion #endif // osfx != 1005 - -#if checked_array_iterator != 1006 -#error bad macro expansion -#endif // checked_array_iterator != 1006 - -#if make_checked_array_iterator != 1007 -#error bad macro expansion -#endif // make_checked_array_iterator != 1007 - -#if make_unchecked_array_iterator != 1008 -#error bad macro expansion -#endif // make_unchecked_array_iterator != 1008 - -#if unchecked_array_iterator != 1009 -#error bad macro expansion -#endif // unchecked_array_iterator != 1009 From cdf229e3fafaad7fcafaed5259f12f1fbf910d0a Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Thu, 30 Oct 2025 09:53:45 -0700 Subject: [PATCH 6/6] Remove unnecessary test usage (originally to silence warnings). --- .../test.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/tests/std/tests/P0040R3_extending_memory_management_tools/test.cpp b/tests/std/tests/P0040R3_extending_memory_management_tools/test.cpp index 26b53c0e6e0..149b7e04323 100644 --- a/tests/std/tests/P0040R3_extending_memory_management_tools/test.cpp +++ b/tests/std/tests/P0040R3_extending_memory_management_tools/test.cpp @@ -1,8 +1,6 @@ // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -#define _SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING - #include #include #include @@ -79,10 +77,7 @@ void test_uninitialized_move() { assert(all_of(begin(ptrs), end(ptrs), booleanTestsTrue)); uninitialized_storage, exampleCount> storage; - assert( - uninitialized_move(begin(ptrs), end(ptrs), stdext::make_checked_array_iterator(storage.begin(), exampleCount)) - .base() - == storage.end()); + assert(uninitialized_move(begin(ptrs), end(ptrs), storage.begin()) == storage.end()); assert(none_of(begin(ptrs), end(ptrs), booleanTestsTrue)); assert(all_of(storage.begin(), storage.end(), booleanTestsTrue)); @@ -98,11 +93,10 @@ void test_uninitialized_move_n() { assert(all_of(begin(ptrs), end(ptrs), booleanTestsTrue)); uninitialized_storage, exampleCount> storage; - const auto result = uninitialized_move_n( - begin(ptrs), exampleCount, stdext::make_checked_array_iterator(storage.begin(), exampleCount)); + const auto result = uninitialized_move_n(begin(ptrs), exampleCount, storage.begin()); assert(result.first == end(ptrs)); - assert(result.second.base() == storage.end()); + assert(result.second == storage.end()); assert(none_of(begin(ptrs), end(ptrs), booleanTestsTrue)); assert(all_of(storage.begin(), storage.end(), booleanTestsTrue)); destroy(storage.begin(), storage.end());