diff --git a/libcxx/docs/Status/Cxx23Papers.csv b/libcxx/docs/Status/Cxx23Papers.csv index e4fa07d82289d..b42e123831881 100644 --- a/libcxx/docs/Status/Cxx23Papers.csv +++ b/libcxx/docs/Status/Cxx23Papers.csv @@ -35,7 +35,7 @@ "`P2301R1 `__","Add a ``pmr`` alias for ``std::stacktrace``","2021-10 (Virtual)","","","" "`P2321R2 `__","``zip``","2021-10 (Virtual)","|In Progress|","","" "`P2340R1 `__","Clarifying the status of the 'C headers'","2021-10 (Virtual)","|Nothing To Do|","","" -"`P2393R1 `__","Cleaning up ``integer``-class types","2021-10 (Virtual)","","","" +"`P2393R1 `__","Cleaning up ``integer``-class types","2021-10 (Virtual)","|Complete|","21","" "`P2401R0 `__","Add a conditional ``noexcept`` specification to ``std::exchange``","2021-10 (Virtual)","|Complete|","14","" "","","","","","" "`P0323R12 `__","``std::expected``","2022-02 (Virtual)","|Complete|","16","" diff --git a/libcxx/include/__ranges/subrange.h b/libcxx/include/__ranges/subrange.h index df8766216dbe2..c40d9b40de1cd 100644 --- a/libcxx/include/__ranges/subrange.h +++ b/libcxx/include/__ranges/subrange.h @@ -117,7 +117,7 @@ class subrange : public view_interface> { convertible_to, _Sent> _LIBCPP_HIDE_FROM_ABI constexpr subrange(_Range&& __range) requires _StoreSize && sized_range<_Range> - : subrange(__range, ranges::size(__range)) {} + : subrange(__range, static_cast(ranges::size(__range))) {} template requires __convertible_to_non_slicing, _Iter> && diff --git a/libcxx/include/__ranges/take_view.h b/libcxx/include/__ranges/take_view.h index 85723dc5e36b6..8ff7c891dc093 100644 --- a/libcxx/include/__ranges/take_view.h +++ b/libcxx/include/__ranges/take_view.h @@ -120,7 +120,7 @@ class take_view : public view_interface> { { if constexpr (sized_range<_View>) { if constexpr (random_access_range<_View>) { - return ranges::begin(__base_) + size(); + return ranges::begin(__base_) + range_difference_t<_View>(size()); } else { return default_sentinel; } @@ -134,7 +134,7 @@ class take_view : public view_interface> { { if constexpr (sized_range) { if constexpr (random_access_range) { - return ranges::begin(__base_) + size(); + return ranges::begin(__base_) + range_difference_t<_View>(size()); } else { return default_sentinel; } diff --git a/libcxx/test/std/iterators/iterator.requirements/iterator.concepts/incrementable.h b/libcxx/test/std/iterators/iterator.requirements/iterator.concepts/incrementable.h index 16eddd6f06e69..16e7bf040c646 100644 --- a/libcxx/test/std/iterators/iterator.requirements/iterator.concepts/incrementable.h +++ b/libcxx/test/std/iterators/iterator.requirements/iterator.concepts/incrementable.h @@ -9,6 +9,8 @@ #ifndef LIBCPP_TEST_STD_ITERATORS_ITERATOR_REQUIREMENTS_ITERATOR_CONCEPTS_INCREMENTABLE_H #define LIBCPP_TEST_STD_ITERATORS_ITERATOR_REQUIREMENTS_ITERATOR_CONCEPTS_INCREMENTABLE_H +#include + struct postfix_increment_returns_void { using difference_type = int; postfix_increment_returns_void& operator++(); @@ -181,4 +183,12 @@ struct noncopyable_with_difference_type_and_minus { bool operator==(noncopyable_with_difference_type_and_minus const&) const; }; +template +struct extended_integral_difference_type { + using difference_type = T; + + extended_integral_difference_type& operator++(); + void operator++(int); +}; + #endif // #define LIBCPP_TEST_STD_ITERATORS_ITERATOR_REQUIREMENTS_ITERATOR_CONCEPTS_INCREMENTABLE_H diff --git a/libcxx/test/std/iterators/iterator.requirements/iterator.concepts/iterator.concept.winc/weakly_incrementable.compile.pass.cpp b/libcxx/test/std/iterators/iterator.requirements/iterator.concepts/iterator.concept.winc/weakly_incrementable.compile.pass.cpp index 22b3ae94e5fc3..c37c6d7e6e707 100644 --- a/libcxx/test/std/iterators/iterator.requirements/iterator.concepts/iterator.concept.winc/weakly_incrementable.compile.pass.cpp +++ b/libcxx/test/std/iterators/iterator.requirements/iterator.concepts/iterator.concept.winc/weakly_incrementable.compile.pass.cpp @@ -18,6 +18,7 @@ #include #include "../incrementable.h" +#include "test_macros.h" static_assert(std::weakly_incrementable); static_assert(std::weakly_incrementable); @@ -67,3 +68,134 @@ static_assert(std::weakly_incrementable); static_assert(std::weakly_incrementable); static_assert(std::weakly_incrementable); static_assert(std::weakly_incrementable); + +#if !defined(TEST_HAS_NO_INT128) +static_assert(std::weakly_incrementable>); +#endif + +#if defined(__BIT_TYPES_DEFINED__) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wbit-int-extension" +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +static_assert(std::weakly_incrementable>); +# pragma GCC diagnostic pop +#endif