-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[libc++] Implements LWG3953 #107535
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[libc++] Implements LWG3953 #107535
Conversation
@llvm/pr-subscribers-libcxx Author: NoumanAmir-10xe (NoumanAmir657) ChangesFor the issue: #105303 Full diff: https://github.com/llvm/llvm-project/pull/107535.diff 2 Files Affected:
diff --git a/libcxx/include/__iterator/common_iterator.h b/libcxx/include/__iterator/common_iterator.h
index 199de2cc7337b0..ff382f32fe8950 100644
--- a/libcxx/include/__iterator/common_iterator.h
+++ b/libcxx/include/__iterator/common_iterator.h
@@ -235,7 +235,7 @@ class common_iterator {
return std::__unchecked_get<_Sent>(__x.__hold_) - std::__unchecked_get<_I2>(__y.__hold_);
}
- _LIBCPP_HIDE_FROM_ABI friend constexpr iter_rvalue_reference_t<_Iter>
+ _LIBCPP_HIDE_FROM_ABI friend constexpr decltype(auto)
iter_move(const common_iterator& __i) noexcept(noexcept(ranges::iter_move(std::declval<const _Iter&>())))
requires input_iterator<_Iter>
{
diff --git a/libcxx/include/__iterator/counted_iterator.h b/libcxx/include/__iterator/counted_iterator.h
index ea2832e3b978dc..a02c61bf34e2f9 100644
--- a/libcxx/include/__iterator/counted_iterator.h
+++ b/libcxx/include/__iterator/counted_iterator.h
@@ -249,7 +249,7 @@ class counted_iterator
return __rhs.__count_ <=> __lhs.__count_;
}
- _LIBCPP_HIDE_FROM_ABI friend constexpr iter_rvalue_reference_t<_Iter>
+ _LIBCPP_HIDE_FROM_ABI friend constexpr decltype(auto)
iter_move(const counted_iterator& __i) noexcept(noexcept(ranges::iter_move(__i.__current_)))
requires input_iterator<_Iter>
{
|
It would be better to use GitHub's close/fix/resolve syntax in the PR description to associate this PR with the issue. Also, it's better to explicitly say LWG3953 in the title of this PR. Note that the actual return types remain unchanged. |
Fixed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No change requested. The modification is almost, if not exactly, NFC, given input_iterator
has already required that iter_rvalue_reference_t
is valid.
It would be extremely weird to me to test something (if exists) for which iter_rvalue_reference_t
results in substitution failure while input_iterator
gives hard error (caused by some stuff checked before iter_rvalue_reference_t
).
You still need to update the cvs file I think:
|
Updated. Thanks! |
Any idea why the CI failed? @frederick-vs-ja @Zingam . |
I restarted the failed CI job. Let's wait to see if it will pass. |
Aha okay. Thanks. |
Yeah seems like it passed now. |
@NoumanAmir657 Thanks for the patch! Please turn off the "hide my email" feature of Github for your future contributions since we require a valid email address for LLVM contributions. |
Closes #105303