// RUN: %clang_cc1 -std=c++2c -fexperimental-new-constant-interpreter -verify=expected,both %s // RUN: %clang_cc1 -std=c++2c -verify=ref,both %s // both-no-diagnostics namespace std { template struct integral_constant { static const int value = __v; }; using size_t = decltype(sizeof(int)); template concept __weakly_equality_comparable_with = requires(_Tp __t) { __t; }; template struct tuple_element; template struct tuple_size; template concept input_or_output_iterator = requires(_Ip __i) { __i; }; template concept sentinel_for = __weakly_equality_comparable_with<_Sp, _Ip>; namespace ranges { enum subrange_kind { unsized }; template _Sent, subrange_kind = unsized> struct subrange { _Iter __begin_; _Sent __end_; constexpr _Sent end() { return __end_; } }; template constexpr auto get(subrange<_Iter, _Sent, _Kind> __subrange) { return __subrange.end(); } } // namespace ranges template struct tuple_size> : integral_constant {}; template struct tuple_element<0, ranges::subrange<_Ip, _Sp, _Kp>> { using type = _Ip; }; template struct tuple_element<1, ranges::subrange<_Ip, _Sp, _Kp>> { using type = _Sp; }; } // namespace std constexpr bool test() { int a[1]; auto r = std::ranges::subrange(a, a); auto [first, last] = r; last = a; return true; } static_assert(test());