Skip to content

Conversation

changkhothuychung
Copy link
Contributor

@changkhothuychung changkhothuychung commented Aug 14, 2025

close #105320

@changkhothuychung changkhothuychung requested a review from a team as a code owner August 14, 2025 20:37
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Aug 14, 2025
@changkhothuychung changkhothuychung marked this pull request as draft August 14, 2025 20:37
@llvmbot
Copy link
Member

llvmbot commented Aug 14, 2025

@llvm/pr-subscribers-libcxx

Author: Nhat Nguyen (changkhothuychung)

Changes

close #105320


Full diff: https://github.com/llvm/llvm-project/pull/153674.diff

1 Files Affected:

  • (modified) libcxx/include/__ranges/common_view.h (+2-2)
diff --git a/libcxx/include/__ranges/common_view.h b/libcxx/include/__ranges/common_view.h
index 133236dd1d78a..ff26a78c00052 100644
--- a/libcxx/include/__ranges/common_view.h
+++ b/libcxx/include/__ranges/common_view.h
@@ -58,7 +58,7 @@ class common_view : public view_interface<common_view<_View>> {
 
   _LIBCPP_HIDE_FROM_ABI constexpr _View base() && { return std::move(__base_); }
 
-  _LIBCPP_HIDE_FROM_ABI constexpr auto begin() {
+  _LIBCPP_HIDE_FROM_ABI constexpr auto begin() requires (!__simple_view<_View>) {
     if constexpr (random_access_range<_View> && sized_range<_View>)
       return ranges::begin(__base_);
     else
@@ -74,7 +74,7 @@ class common_view : public view_interface<common_view<_View>> {
       return common_iterator<iterator_t<const _View>, sentinel_t<const _View>>(ranges::begin(__base_));
   }
 
-  _LIBCPP_HIDE_FROM_ABI constexpr auto end() {
+  _LIBCPP_HIDE_FROM_ABI constexpr auto end() requires (!__simple_view<_View>) {
     if constexpr (random_access_range<_View> && sized_range<_View>)
       return ranges::begin(__base_) + ranges::size(__base_);
     else

Copy link

github-actions bot commented Aug 14, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

@changkhothuychung changkhothuychung marked this pull request as ready for review August 14, 2025 21:23
@Zingam
Copy link
Contributor

Zingam commented Aug 15, 2025

Please add a SFINAE test.

@changkhothuychung
Copy link
Contributor Author

@H-G-Hristov reminder ping, looks like the CI fails are unrelated.

Copy link
Contributor

@H-G-Hristov H-G-Hristov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@H-G-Hristov reminder ping, looks like the CI fails are unrelated.

Please wait for a libc++ maintainer to approve before merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LWG4012: common_view::begin/end are missing the simple-view check

4 participants