[libcxx-commits] [PATCH] D144994: [Draft][libc++][modules] Adds std module.

Aaron Siddhartha Mondal via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Mar 12 09:36:11 PDT 2023


aaronmondal added inline comments.


================
Comment at: libcxx/docs/Modules.rst:83
+
+    * ``__synth_three_way_result`` does not work. There is a work-around in libc++.
+
----------------
Ah yes this fails due to template (mis)deduction with lambdas if I remember correctly. This works around it but it was decided some time ago that this shouldn't be changed in libc++ due to "work around compiler bug" not being a good reason for a change.

```
diff --git a/libcxx/include/__compare/synth_three_way.h b/libcxx/include/__compare/synth_three_way.h
index fa8cbda79ba2..a6df1b936c72 100644
--- a/libcxx/include/__compare/synth_three_way.h
+++ b/libcxx/include/__compare/synth_three_way.h
@@ -25,8 +25,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 
 // [expos.only.func]
 
-_LIBCPP_HIDE_FROM_ABI inline constexpr auto __synth_three_way =
-  []<class _Tp, class _Up>(const _Tp& __t, const _Up& __u)
+template<class _Tp, class _Up>
+_LIBCPP_HIDE_FROM_ABI inline constexpr auto __synth_three_way(const _Tp& __t, const _Up& __u)
     requires requires {
       { __t < __u } -> __boolean_testable;
       { __u < __t } -> __boolean_testable;
```


================
Comment at: libcxx/stdmodules/std-string_view.cppm:47
+      // [string.view.literals], suffix for basic_string_view literals
+      using std::literals::string_view_literals::operator"" sv;
+    }
----------------



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144994/new/

https://reviews.llvm.org/D144994



More information about the libcxx-commits mailing list