// 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 { inline namespace { template using conditional_t = _IfRes; template concept input_iterator = requires { typename _Ip; }; auto end = int{}; namespace ranges { template concept range = requires { end; }; template concept input_range = input_iterator<_Tp>; template concept forward_range = false; template struct owning_view { _Rp __r_; }; } // namespace ranges template struct array { int __elems_[_Size]; }; template struct allocator { constexpr array<2> *allocate(decltype(sizeof(int))) { return static_cast *>(operator new(sizeof(array<2>))); } }; namespace ranges { template struct join_with_view { join_with_view(_View, _Pattern); }; } // namespace ranges template struct vector { constexpr ~vector() { (__end_ - 1)->~array<2>(); } constexpr vector() { __end_ = __alloc_.allocate(0); _ConstructTransaction __tx(*this); ++__tx.__pos_; } array<2>* __end_; allocator> __alloc_; struct _ConstructTransaction { constexpr _ConstructTransaction(vector &__v) : __v_(__v), __pos_(__v.__end_) {} constexpr ~_ConstructTransaction() { __v_.__end_ = __pos_; } vector __v_; array<2>* __pos_; }; }; } // namespace } // namespace std template using VRange = std::conditional_t, Inner>; template void test_pre_increment() { using V = VRange>; using Pattern = std::array<2>; using JWV = std::ranges::join_with_view, std::ranges::owning_view>; JWV jwv({}, {}); }