[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 14:26:45 PST 2022
rupprecht updated this revision to Diff 405794.
rupprecht added a comment.
- Restoring original version of the patch
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D118940/new/
https://reviews.llvm.org/D118940
Files:
libcxx/include/__algorithm/comp_ref_type.h
libcxx/test/libcxx/algorithms/debug_less.pass.cpp
Index: libcxx/test/libcxx/algorithms/debug_less.pass.cpp
===================================================================
--- libcxx/test/libcxx/algorithms/debug_less.pass.cpp
+++ libcxx/test/libcxx/algorithms/debug_less.pass.cpp
@@ -270,7 +270,7 @@
assert(dl(static_cast<int&&>(1), static_cast<const int&&>(2)));
}
-#if TEST_STD_VER > 17
+#if TEST_STD_VER > 11
constexpr bool test_constexpr() {
std::less<> cmp{};
__debug_less<std::less<> > dcmp(cmp);
@@ -287,7 +287,7 @@
test_non_const_arg_cmp();
test_value_iterator();
test_value_categories();
-#if TEST_STD_VER > 17
+#if TEST_STD_VER > 11
static_assert(test_constexpr(), "");
#endif
return 0;
Index: libcxx/include/__algorithm/comp_ref_type.h
===================================================================
--- libcxx/include/__algorithm/comp_ref_type.h
+++ libcxx/include/__algorithm/comp_ref_type.h
@@ -28,11 +28,11 @@
struct __debug_less
{
_Compare &__comp_;
- _LIBCPP_CONSTEXPR_AFTER_CXX17
+ _LIBCPP_CONSTEXPR_AFTER_CXX11
__debug_less(_Compare& __c) : __comp_(__c) {}
template <class _Tp, class _Up>
- _LIBCPP_CONSTEXPR_AFTER_CXX17
+ _LIBCPP_CONSTEXPR_AFTER_CXX11
bool operator()(const _Tp& __x, const _Up& __y)
{
bool __r = __comp_(__x, __y);
@@ -42,7 +42,7 @@
}
template <class _Tp, class _Up>
- _LIBCPP_CONSTEXPR_AFTER_CXX17
+ _LIBCPP_CONSTEXPR_AFTER_CXX11
bool operator()(_Tp& __x, _Up& __y)
{
bool __r = __comp_(__x, __y);
@@ -52,7 +52,7 @@
}
template <class _LHS, class _RHS>
- _LIBCPP_CONSTEXPR_AFTER_CXX17
+ _LIBCPP_CONSTEXPR_AFTER_CXX11
inline _LIBCPP_INLINE_VISIBILITY
decltype((void)declval<_Compare&>()(
declval<_LHS &>(), declval<_RHS &>()))
@@ -62,7 +62,7 @@
}
template <class _LHS, class _RHS>
- _LIBCPP_CONSTEXPR_AFTER_CXX17
+ _LIBCPP_CONSTEXPR_AFTER_CXX11
inline _LIBCPP_INLINE_VISIBILITY
void __do_compare_assert(long, _LHS &, _RHS &) {}
};
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118940.405794.patch
Type: text/x-patch
Size: 2024 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220203/3b4ec851/attachment.bin>
More information about the libcxx-commits
mailing list