[libcxx-commits] [libcxx] d6c4ebb - [libc++][ranges] Exports operator|. (#90071)

via libcxx-commits libcxx-commits at lists.llvm.org
Fri Apr 26 09:20:49 PDT 2024


Author: Mark de Wever
Date: 2024-04-26T18:20:45+02:00
New Revision: d6c4ebbf78c67cd298f6ba2da6c06e2362f4d0f4

URL: https://github.com/llvm/llvm-project/commit/d6c4ebbf78c67cd298f6ba2da6c06e2362f4d0f4
DIFF: https://github.com/llvm/llvm-project/commit/d6c4ebbf78c67cd298f6ba2da6c06e2362f4d0f4.diff

LOG: [libc++][ranges] Exports operator|. (#90071)

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

Fixes: https://github.com/llvm/llvm-project/issues/89898

Added: 
    

Modified: 
    libcxx/modules/std/ranges.inc

Removed: 
    


################################################################################
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


        


More information about the libcxx-commits mailing list