// RUN: %clang_cc1 -std=c++2c -fexperimental-new-constant-interpreter -verify=expected,both %s // RUN: %clang_cc1 -std=c++2c -verify=ref,both %s /// This used to cause an assertion failure because we were deallocating a /// dynamic block that was already dead. namespace std { inline namespace __1 { template struct integral_constant { static inline constexpr const _Tp value = __v; }; typedef integral_constant true_type; typedef integral_constant false_type; template using _BoolConstant = integral_constant; template using __remove_cv_t = __remove_cv(_Tp); template using remove_cv_t = __remove_cv_t<_Tp>; template inline constexpr bool is_lvalue_reference_v = __is_lvalue_reference(_Tp); template using __libcpp_remove_reference_t = __remove_reference_t(_Tp); template constexpr _Tp &&forward(__libcpp_remove_reference_t<_Tp> &__t) noexcept; template struct conditional { using type = _If; }; template using conditional_t = typename conditional<_Bp, _IfRes, _ElseRes>::type; template using _IsSame = _BoolConstant<__is_same(_Tp, _Up)>; using size_t = decltype(sizeof(int)); template using __decay_t = __decay(_Tp); template using decay_t = __decay_t<_Tp>; template struct enable_if; template struct enable_if { typedef _Tp type; }; template using __enable_if_t = typename enable_if<_Bp, _Tp>::type; template inline constexpr bool is_base_of_v = __is_base_of(_Bp, _Dp); template _Tp &&__declval(int); template decltype(std::__declval<_Tp>(0)) declval() noexcept; template struct __invokable_r {}; template using __is_invocable = __invokable_r; template inline const bool __is_invocable_v = __is_invocable<_Func, _Args...>::value; template struct __invoke_result : enable_if<__is_invocable_v<_Func, _Args...>, typename __invokable_r::_Result> {}; template struct invoke_result : __invoke_result<_Fn, _Args...> {}; template inline constexpr bool is_constructible_v = __is_constructible(_Tp, _Args...); template constexpr __libcpp_remove_reference_t<_Tp> &&move(_Tp &&__t) noexcept; template inline constexpr bool is_enum_v = __is_enum(_Tp); template inline constexpr bool is_convertible_v = __is_convertible(_From, _To); template concept convertible_to = is_convertible_v<_From, _To> && requires { static_cast<_To>(std::declval<_From>()); }; template concept __same_as_impl = _IsSame<_Tp, _Up>::value; template concept same_as = __same_as_impl<_Tp, _Up> && __same_as_impl<_Up, _Tp>; template using __remove_cvref_t = __remove_cvref(_Tp); template using remove_cvref_t = __remove_cvref_t<_Tp>; template using __make_const_lvalue_ref = const __libcpp_remove_reference_t<_Tp> &; template concept assignable_from = is_lvalue_reference_v<_Lhs> && requires(_Lhs __lhs, _Rhs &&__rhs) { { __lhs = std::forward<_Rhs>(__rhs) } -> same_as<_Lhs>; }; template struct is_nothrow_destructible : integral_constant {}; template inline constexpr bool is_nothrow_destructible_v = is_nothrow_destructible<_Tp>::value; template concept destructible = is_nothrow_destructible_v<_Tp>; template concept constructible_from = destructible<_Tp> && is_constructible_v<_Tp, _Args...>; template concept __default_initializable = requires { ::new _Tp; }; template concept default_initializable = constructible_from<_Tp> && requires { _Tp{}; } && __default_initializable<_Tp>; template concept move_constructible = constructible_from<_Tp, _Tp> && convertible_to<_Tp, _Tp>; template inline constexpr bool is_class_v = __is_class(_Tp); template inline constexpr bool is_union_v = __is_union(_Tp); template concept __class_or_enum = is_class_v<_Tp> || is_union_v<_Tp> || is_enum_v<_Tp>; namespace ranges { namespace __swap { template concept __unqualified_swappable_with = (__class_or_enum> || __class_or_enum>) && requires(_Tp &&__t, _Up &&__u) { swap(std::forward<_Tp>(__t), std::forward<_Up>(__u)); }; template concept __exchangeable = !__unqualified_swappable_with<_Tp &, _Tp &> && move_constructible<_Tp> && assignable_from<_Tp &, _Tp>; struct __fn { template <__exchangeable _Tp> constexpr void operator()(_Tp &__x, _Tp &__y) const; }; } // namespace __swap inline namespace __cpo { inline constexpr auto swap = __swap::__fn{}; } } // namespace ranges template inline constexpr bool is_object_v = __is_object(_Tp); template concept movable = is_object_v<_Tp> && move_constructible<_Tp> && assignable_from<_Tp &, _Tp>; template concept copyable = assignable_from<_Tp &, const _Tp &> && assignable_from<_Tp &, const _Tp>; template concept derived_from = is_base_of_v<_Bp, _Dp> && is_convertible_v; template concept __boolean_testable_impl = convertible_to<_Tp, bool>; template concept __boolean_testable = __boolean_testable_impl<_Tp> && requires(_Tp &&__t) { { !std::forward<_Tp>(__t) } -> __boolean_testable_impl; }; template concept __weakly_equality_comparable_with = requires( __make_const_lvalue_ref<_Tp> __t, __make_const_lvalue_ref<_Up> __u) { { __u != __t } -> __boolean_testable; }; template concept semiregular = copyable<_Tp> && default_initializable<_Tp>; template