Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stl/inc/xutility
Original file line number Diff line number Diff line change
Expand Up @@ -1862,7 +1862,7 @@ public:
return static_cast<_Reference>(*_Current);
}

_NODISCARD constexpr const value_type* operator->() const
_NODISCARD constexpr const auto* operator->() const
noexcept(contiguous_iterator<_Iter> || noexcept(*_Current)) /* strengthened */
requires is_lvalue_reference_v<iter_reference_t<_Iter>>
&& same_as<remove_cvref_t<iter_reference_t<_Iter>>, value_type>
Expand Down
5 changes: 5 additions & 0 deletions tests/std/tests/P2278R4_basic_const_iterator/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,11 @@ constexpr void test_one(It iter) {
}
}

void test_lwg3853() { // COMPILE-ONLY
basic_const_iterator<volatile int*> it;
[[maybe_unused]] same_as<const volatile int*> auto ptr = it.operator->();
}

static constexpr int some_ints[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};

struct instantiator {
Expand Down