[libcxx-commits] [PATCH] D118940: [libc++] Fix std::__debug_less in c++17.

Jordan Rupprecht via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Feb 3 13:40:50 PST 2022


rupprecht added inline comments.


================
Comment at: libcxx/include/__algorithm/comp_ref_type.h:51
     template <class _LHS, class _RHS>
-    _LIBCPP_CONSTEXPR_AFTER_CXX17
-    inline _LIBCPP_INLINE_VISIBILITY
-    decltype((void)declval<_Compare&>()(
-        declval<_LHS &>(), declval<_RHS &>()))
-    __do_compare_assert(int, _LHS & __l, _RHS & __r) {
-        _LIBCPP_ASSERT(!__comp_(__l, __r),
-            "Comparator does not induce a strict weak ordering");
+    _LIBCPP_CONSTEXPR_AFTER_CXX11 inline _LIBCPP_HIDE_FROM_ABI decltype((void)declval<_Compare&>()(declval<_LHS&>(),
+                                                                                                   declval<_RHS&>()))
----------------
FYI, this change doesn't look very pleasant, but the clang-format test on libcxx CI was failing, and clang-format does this.


================
Comment at: libcxx/include/__algorithm/comp_ref_type.h:25
 
 #ifdef _LIBCPP_DEBUG
 
----------------
philnik wrote:
> Pre-existing: This should be `_LIBCPP_DEBUG_LEVEL == 1`.
IIUC, `_LIBCPP_DEBUG_LEVEL=2` should provide a superset of `_LIBCPP_DEBUG_LEVEL=1`: https://github.com/llvm/llvm-project/blob/c3c1c5c6953fcf9320a0cae5121ce55839169790/libcxx/include/__config#L907

Did you want `#if _LIBCPP_DEBUG_LEVEL >= 1`?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D118940



More information about the libcxx-commits mailing list