Skip to content

[libc++][ranges] Exports operator|. #90071

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

Merged
merged 1 commit into from
Apr 26, 2024

Conversation

mordante
Copy link
Member

This was omitted in c108653 and not detected by the CI since clang-tidy is not running. This fixes the exports.

Fixes: #89898

This was omitted in c108653 and not detected by the CI since
clang-tidy is not running. This fixes the exports.

Fixes: llvm#89898
@mordante mordante requested a review from a team as a code owner April 25, 2024 16:06
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Apr 25, 2024
@llvmbot
Copy link
Member

llvmbot commented Apr 25, 2024

@llvm/pr-subscribers-libcxx

Author: Mark de Wever (mordante)

Changes

This was omitted in c108653 and not detected by the CI since clang-tidy is not running. This fixes the exports.

Fixes: #89898


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

1 Files Affected:

  • (modified) libcxx/modules/std/ranges.inc (+11)
diff --git a/libcxx/modules/std/ranges.inc b/libcxx/modules/std/ranges.inc
index 7d215867a4317f..80f31c79a1a405 100644
--- a/libcxx/modules/std/ranges.inc
+++ b/libcxx/modules/std/ranges.inc
@@ -141,6 +141,17 @@ export namespace std {
 #if _LIBCPP_STD_VER >= 23
     // [range.adaptor.object], range adaptor objects
     using std::ranges::range_adaptor_closure;
+    // Note: This declaration not in the synopsis or explicitly in the wording.
+    // However it is needed for the range adaptors.
+    // [range.adaptor.object]/3
+    //   The template parameter D for range_adaptor_closure may be an
+    //   incomplete type. If an expression of type cv D is used as an operand
+    //   to the | operator, D shall be complete and model
+    //   derived_from<range_adaptor_closure<D>>. The behavior of an expression
+    //   involving an object of type cv D as an operand to the | operator is
+    //   undefined if overload resolution selects a program-defined operator|
+    //   function.
+    using std::ranges::operator|;
 #endif
 
     // [range.all], all view

@mordante
Copy link
Member Author

Note I verified the module tests locally and they passed.

@ldionne ldionne self-assigned this Apr 26, 2024
@mordante mordante merged commit d6c4ebb into llvm:main Apr 26, 2024
54 checks passed
@mordante mordante deleted the review/export_ranges_pipe_operator branch April 26, 2024 16:21
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.

Ranges pipe syntax broken after commit #c1086532d4d5 when using std module.
3 participants