CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
54 lines
1.7 KiB
C++
54 lines
1.7 KiB
C++
// 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 <class, int __v> struct integral_constant {
|
|
static const int value = __v;
|
|
};
|
|
using size_t = decltype(sizeof(int));
|
|
template <class _Tp, class>
|
|
concept __weakly_equality_comparable_with = requires(_Tp __t) { __t; };
|
|
template <size_t, class> struct tuple_element;
|
|
template <class> struct tuple_size;
|
|
template <class _Ip>
|
|
concept input_or_output_iterator = requires(_Ip __i) { __i; };
|
|
template <class _Sp, class _Ip>
|
|
concept sentinel_for = __weakly_equality_comparable_with<_Sp, _Ip>;
|
|
namespace ranges {
|
|
enum subrange_kind { unsized };
|
|
template <input_or_output_iterator _Iter, sentinel_for<_Iter> _Sent,
|
|
subrange_kind = unsized>
|
|
struct subrange {
|
|
_Iter __begin_;
|
|
_Sent __end_;
|
|
constexpr _Sent end() { return __end_; }
|
|
};
|
|
template <int, class _Iter, class _Sent, subrange_kind _Kind>
|
|
constexpr auto get(subrange<_Iter, _Sent, _Kind> __subrange) {
|
|
return __subrange.end();
|
|
}
|
|
} // namespace ranges
|
|
template <class _Ip, class _Sp, ranges::subrange_kind _Kp>
|
|
struct tuple_size<ranges::subrange<_Ip, _Sp, _Kp>>
|
|
: integral_constant<size_t, 2> {};
|
|
template <class _Ip, class _Sp, ranges::subrange_kind _Kp>
|
|
struct tuple_element<0, ranges::subrange<_Ip, _Sp, _Kp>> {
|
|
using type = _Ip;
|
|
};
|
|
template <class _Ip, class _Sp, ranges::subrange_kind _Kp>
|
|
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());
|
|
|