Skip to content

Commit 466abe1

Browse files
Fixes for _LIBCPP_NODEBUG, std module, and tests
1 parent 3283347 commit 466abe1

File tree

4 files changed

+16
-15
lines changed

4 files changed

+16
-15
lines changed

libcxx/include/__iterator/const_iterator.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
4646
#if _LIBCPP_STD_VER >= 23
4747

4848
template <indirectly_readable _Iter>
49-
using iter_const_reference_t = common_reference_t<const iter_value_t<_Iter>&&, iter_reference_t<_Iter>>;
49+
using iter_const_reference_t _LIBCPP_NODEBUG = common_reference_t<const iter_value_t<_Iter>&&, iter_reference_t<_Iter>>;
5050

5151
template <class _Iter>
5252
concept __constant_iterator = input_iterator<_Iter> && same_as<iter_const_reference_t<_Iter>, iter_reference_t<_Iter>>;
@@ -60,12 +60,12 @@ using const_iterator = conditional_t<__constant_iterator<_Iter>, _Iter, basic_co
6060
// This doesn't use `conditional_t` to avoid instantiating const_iterator<_Sent> when _Sent is not an input_iterator.
6161
template <class _Sent>
6262
struct __const_sentinel_impl {
63-
using type = _Sent;
63+
using type _LIBCPP_NODEBUG = _Sent;
6464
};
6565
template <class _Sent>
6666
requires input_iterator<_Sent>
6767
struct __const_sentinel_impl<_Sent> {
68-
using type = const_iterator<_Sent>;
68+
using type _LIBCPP_NODEBUG = const_iterator<_Sent>;
6969
};
7070
template <semiregular _Sent>
7171
using const_sentinel = __const_sentinel_impl<_Sent>::type;
@@ -104,8 +104,8 @@ template <input_iterator _Iter>
104104
class _LIBCPP_TEMPLATE_VIS basic_const_iterator : public __basic_const_iterator_category<_Iter> {
105105
_Iter __current_ = _Iter();
106106

107-
using __reference = iter_const_reference_t<_Iter>;
108-
using __rvalue_reference = __iter_const_rvalue_reference_t<_Iter>;
107+
using __reference _LIBCPP_NODEBUG = iter_const_reference_t<_Iter>;
108+
using __rvalue_reference _LIBCPP_NODEBUG = __iter_const_rvalue_reference_t<_Iter>;
109109

110110
public:
111111
using value_type = iter_value_t<_Iter>;
@@ -322,17 +322,17 @@ class _LIBCPP_TEMPLATE_VIS basic_const_iterator : public __basic_const_iterator_
322322
template <class _Type1, common_with<_Type1> _Type2>
323323
requires input_iterator<common_type_t<_Type1, _Type2>>
324324
struct common_type<basic_const_iterator<_Type1>, _Type2> {
325-
using type = basic_const_iterator<common_type_t<_Type1, _Type2>>;
325+
using type _LIBCPP_NODEBUG = basic_const_iterator<common_type_t<_Type1, _Type2>>;
326326
};
327327
template <class _Type1, common_with<_Type1> _Type2>
328328
requires input_iterator<common_type_t<_Type1, _Type2>>
329329
struct common_type<_Type2, basic_const_iterator<_Type1>> {
330-
using type = basic_const_iterator<common_type_t<_Type1, _Type2>>;
330+
using type _LIBCPP_NODEBUG = basic_const_iterator<common_type_t<_Type1, _Type2>>;
331331
};
332332
template <class _Type1, common_with<_Type1> _Type2>
333333
requires input_iterator<common_type_t<_Type1, _Type2>>
334334
struct common_type<basic_const_iterator<_Type1>, basic_const_iterator<_Type2>> {
335-
using type = basic_const_iterator<common_type_t<_Type1, _Type2>>;
335+
using type _LIBCPP_NODEBUG = basic_const_iterator<common_type_t<_Type1, _Type2>>;
336336
};
337337

338338
template <input_iterator _Iter>

libcxx/include/__ranges/const_access.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ namespace __cbegin {
5353
struct __fn {
5454
# if _LIBCPP_STD_VER >= 23
5555
template <class _Rng>
56-
using _UType = decltype(ranges::begin(ranges::__possibly_const_range(std::declval<_Rng&>())));
56+
using _UType _LIBCPP_NODEBUG = decltype(ranges::begin(ranges::__possibly_const_range(std::declval<_Rng&>())));
5757

5858
template <__const_accessible_range _Rng>
5959
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr static auto operator()(_Rng&& __rng) noexcept(
@@ -100,7 +100,7 @@ namespace __cend {
100100
struct __fn {
101101
# if _LIBCPP_STD_VER >= 23
102102
template <class _Rng>
103-
using _UType = decltype(ranges::end(ranges::__possibly_const_range(std::declval<_Rng&>())));
103+
using _UType _LIBCPP_NODEBUG = decltype(ranges::end(ranges::__possibly_const_range(std::declval<_Rng&>())));
104104

105105
template <__const_accessible_range _Rng>
106106
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr static auto operator()(_Rng&& __rng) noexcept(
@@ -147,7 +147,7 @@ namespace __crbegin {
147147
struct __fn {
148148
# if _LIBCPP_STD_VER >= 23
149149
template <class _Rng>
150-
using _UType = decltype(ranges::rbegin(ranges::__possibly_const_range(std::declval<_Rng&>())));
150+
using _UType _LIBCPP_NODEBUG = decltype(ranges::rbegin(ranges::__possibly_const_range(std::declval<_Rng&>())));
151151

152152
template <__const_accessible_range _Rng>
153153
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr static auto operator()(_Rng&& __rng) noexcept(
@@ -186,7 +186,7 @@ namespace __crend {
186186
struct __fn {
187187
# if _LIBCPP_STD_VER >= 23
188188
template <class _Rng>
189-
using _UType = decltype(ranges::rend(ranges::__possibly_const_range(std::declval<_Rng&>())));
189+
using _UType _LIBCPP_NODEBUG = decltype(ranges::rend(ranges::__possibly_const_range(std::declval<_Rng&>())));
190190

191191
template <__const_accessible_range _Rng>
192192
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr static auto operator()(_Rng&& __rng) noexcept(

libcxx/modules/std/ranges.inc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,14 +265,15 @@ export namespace std {
265265
using std::ranges::views::reverse;
266266
} // namespace views
267267

268+
#if _LIBCPP_STD_VER >= 23
268269
// [range.as.const], as const view
269-
#if 0
270270
using std::ranges::as_const_view;
271271

272272
namespace views {
273273
using std::ranges::views::as_const;
274274
} // namespace views
275-
#endif
275+
#endif // _LIBCPP_STD_VER >= 23
276+
276277
// [range.elements], elements view
277278
using std::ranges::elements_view;
278279

libcxx/test/std/containers/views/views.span/span.iterators/rend.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include "test_macros.h"
2020

2121
template <class Span, class Iter>
22-
constexpr bool testSpanImpl(Span s, Iter rlast) {
22+
constexpr void testSpanImpl(Span s, Iter rlast) {
2323
if (s.empty()) {
2424
assert(rlast == s.rbegin());
2525
} else {

0 commit comments

Comments
 (0)