Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libcxx/docs/Status/Cxx23Issues.csv
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
"`LWG3598 <https://wg21.link/LWG3598>`__","``system_category().default_error_condition(0)`` is underspecified","2022-02 (Virtual)","","","`#104945 <https://github.com/llvm/llvm-project/issues/104945>`__",""
"`LWG3601 <https://wg21.link/LWG3601>`__","common_iterator's postfix-proxy needs ``indirectly_readable`` ","2022-02 (Virtual)","","","`#104946 <https://github.com/llvm/llvm-project/issues/104946>`__",""
"`LWG3607 <https://wg21.link/LWG3607>`__","``contiguous_iterator`` should not be allowed to have custom ``iter_move`` and ``iter_swap`` behavior","2022-02 (Virtual)","|Nothing To Do|","","`#104947 <https://github.com/llvm/llvm-project/issues/104947>`__",""
"`LWG3610 <https://wg21.link/LWG3610>`__","``iota_view::size`` sometimes rejects integer-class types","2022-02 (Virtual)","","","`#104948 <https://github.com/llvm/llvm-project/issues/104948>`__",""
"`LWG3610 <https://wg21.link/LWG3610>`__","``iota_view::size`` sometimes rejects integer-class types","2022-02 (Virtual)","|Complete|","22","`#104948 <https://github.com/llvm/llvm-project/issues/104948>`__",""
"`LWG3612 <https://wg21.link/LWG3612>`__","Inconsistent pointer alignment in ``std::format`` ","2022-02 (Virtual)","|Complete|","14","`#104949 <https://github.com/llvm/llvm-project/issues/104949>`__",""
"`LWG3616 <https://wg21.link/LWG3616>`__","LWG 3498 seems to miss the non-member ``swap`` for ``basic_syncbuf`` ","2022-02 (Virtual)","|Complete|","18","`#104950 <https://github.com/llvm/llvm-project/issues/104950>`__",""
"`LWG3618 <https://wg21.link/LWG3618>`__","Unnecessary ``iter_move`` for ``transform_view::iterator`` ","2022-02 (Virtual)","|Complete|","19","`#104951 <https://github.com/llvm/llvm-project/issues/104951>`__",""
Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/__ranges/iota_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ class iota_view : public view_interface<iota_view<_Start, _BoundSentinel>> {

_LIBCPP_HIDE_FROM_ABI constexpr auto size() const
requires(same_as<_Start, _BoundSentinel> && __advanceable<_Start>) ||
(integral<_Start> && integral<_BoundSentinel>) || sized_sentinel_for<_BoundSentinel, _Start>
(__integer_like<_Start> && __integer_like<_BoundSentinel>) || sized_sentinel_for<_BoundSentinel, _Start>
{
if constexpr (__integer_like<_Start> && __integer_like<_BoundSentinel>) {
return (__value_ < 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ constexpr void testType() {

constexpr bool test() {
testType<SomeInt>();
#ifndef TEST_HAS_NO_INT128
testType<__int128_t>();
testType<__uint128_t>();
#endif
testType<long long>();
testType<unsigned long long>();
testType<signed long>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ constexpr void testType(U u) {
constexpr bool test() {
testType<SomeInt>(SomeInt(10));
testType<SomeInt>(IntComparableWith(SomeInt(10)));
#ifndef TEST_HAS_NO_INT128
testType<__int128_t>(__int128_t(10));
testType<__uint128_t>(__uint128_t(10));
#endif
testType<signed long long>(10LL);
testType<unsigned long long>(10ULL);
testType<signed long long>(IntComparableWith<signed long long>(10));
testType<unsigned long long>(IntComparableWith<unsigned long long>(10));
testType<signed long>(IntComparableWith<signed long>(10));
testType<unsigned long>(IntComparableWith<unsigned long>(10));
testType<int>(IntComparableWith<int>(10));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ constexpr void testType() {
constexpr bool test() {
testType<SomeInt>();
testType<NotNoexceptCopy>();
#ifndef TEST_HAS_NO_INT128
testType<__int128_t>();
testType<__uint128_t>();
#endif
testType<signed long long>();
testType<unsigned long long>();
testType<signed long>();
testType<unsigned long>();
testType<int>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ constexpr void testType() {

constexpr bool test() {
testType<SomeInt>();
#ifndef TEST_HAS_NO_INT128
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While we're at it, I suppose we could/should add int128_t support for the remaining member functions of iota_view?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean updating the remaining tests or something else? These specific changes are from my initial attempt to update iota_view to support int128_t, which was then implemented in #167869 and after I rebased I didn't remove them.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, what I'm saying is that I think we can expand the testing for int128_t further. This should arguably have been done in #167869 but late is better than never.

testType<__int128_t>();
testType<__uint128_t>();
#endif
testType<signed long long>();
testType<unsigned long long>();
testType<signed long>();
testType<unsigned long>();
testType<int>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@
#include <ranges>

#include "test_macros.h"
#include "type_algorithms.h"
#include "types.h"

template <typename T>
concept HasSize = requires(const T t) { t.size(); };

constexpr bool test() {
// Both are integer like and both are less than zero.
{
Expand Down Expand Up @@ -99,6 +103,15 @@ constexpr bool test() {
assert(sz == 10);
}

// LWG3610: `iota_view::size` sometimes rejects integer-class types
{
types::for_each(types::integer_types{}, []<typename IntegerLikeT>() {
types::for_each(types::integer_types{}, []<typename BoundT>() {
static_assert(HasSize<std::ranges::iota_view<IntegerLikeT, BoundT>>);
});
});
}

return true;
}

Expand Down
Loading