https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96042
Bug ID: 96042 Summary: Reference type of std::ranges::iota is __int128 with -std=c++2a?! Product: gcc Version: 10.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: gcc-bugs at marehr dot dialup.fu-berlin.de Target Milestone: --- The following code ```c++ #include <ranges> using iota_view = std::ranges::iota_view<size_t>; using reference_t = std::ranges::range_difference_t<iota_view>; static_assert(std::same_as<reference_t, __int128>); // why? // but std::numeric_limits is not specialised which indicates that we use __STRICT_ANSI__ using t = std::numeric_limits<__int128>; static_assert(t::is_specialized); ``` https://godbolt.org/z/-XFyYN I don't fully understand what `__int128` and `__STRICT_ANSI__` means, but I think it is unexpected that I get a type that is not described in the standard. I know that `std::indirectly_readable` allows (compiler) implementation defined signed integer types, but from what I have seen, `__int128` is normally only supported / exposed in the gnu standard library if `__STRICT_ANSI__` is not defined. Since `-std=c++2a` does not provide a specialisation for `std::numeric_limits`, I assume that this means, that `__STRICT_ANSI__` is not defined in that mode, and I think this is inconsistent behaviour. Related issues in the range-v3 library: * https://github.com/ericniebler/range-v3/issues/1514 * https://github.com/ericniebler/range-v3/issues/1516