public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-2788] libstdc++: Also move the [[nodiscard]] attributes in <compare>
@ 2021-08-06 13:29 Jonathan Wakely
0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2021-08-06 13:29 UTC (permalink / raw)
To: gcc-cvs, libstdc++-cvs
https://gcc.gnu.org/g:c2a984a3570b908a44a35e43bb48f0a05196156a
commit r12-2788-gc2a984a3570b908a44a35e43bb48f0a05196156a
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Fri Aug 6 13:43:26 2021 +0100
libstdc++: Also move the [[nodiscard]] attributes in <compare>
Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:
* libsupc++/compare (compare_three_way, strong_order)
(weak_order, partial_order, compare_strong_order_fallback)
(compare_weak_order_fallback, compare_partial_order_fallback):
Move nodiscard attributes to correct location.
Diff:
---
libstdc++-v3/libsupc++/compare | 21 +++++++--------------
1 file changed, 7 insertions(+), 14 deletions(-)
diff --git a/libstdc++-v3/libsupc++/compare b/libstdc++-v3/libsupc++/compare
index faeff641437..5aee89e3a6e 100644
--- a/libstdc++-v3/libsupc++/compare
+++ b/libstdc++-v3/libsupc++/compare
@@ -548,9 +548,8 @@ namespace std
template<typename _Tp, typename _Up>
requires three_way_comparable_with<_Tp, _Up>
constexpr auto
- operator()(_Tp&& __t, _Up&& __u) const
+ operator() [[nodiscard]] (_Tp&& __t, _Up&& __u) const
noexcept(noexcept(std::declval<_Tp>() <=> std::declval<_Up>()))
- [[nodiscard]]
{
if constexpr (__detail::__3way_builtin_ptr_cmp<_Tp, _Up>)
{
@@ -672,9 +671,8 @@ namespace std
template<typename _Tp, __decayed_same_as<_Tp> _Up>
requires __strongly_ordered<_Tp, _Up>
constexpr strong_ordering
- operator()(_Tp&& __e, _Up&& __f) const
+ operator() [[nodiscard]] (_Tp&& __e, _Up&& __f) const
noexcept(_S_noexcept<_Tp, _Up>())
- [[nodiscard]]
{
/* FIXME:
if constexpr (floating_point<decay_t<_Tp>>)
@@ -720,9 +718,8 @@ namespace std
template<typename _Tp, __decayed_same_as<_Tp> _Up>
requires __weakly_ordered<_Tp, _Up>
constexpr weak_ordering
- operator()(_Tp&& __e, _Up&& __f) const
+ operator() [[nodiscard]] (_Tp&& __e, _Up&& __f) const
noexcept(_S_noexcept<_Tp, _Up>())
- [[nodiscard]]
{
if constexpr (floating_point<decay_t<_Tp>>)
return __cmp_cust::__fp_weak_ordering(__e, __f);
@@ -766,9 +763,8 @@ namespace std
template<typename _Tp, __decayed_same_as<_Tp> _Up>
requires __partially_ordered<_Tp, _Up>
constexpr partial_ordering
- operator()(_Tp&& __e, _Up&& __f) const
+ operator() [[nodiscard]] (_Tp&& __e, _Up&& __f) const
noexcept(_S_noexcept<_Tp, _Up>())
- [[nodiscard]]
{
if constexpr (__adl_partial<_Tp, _Up>)
return partial_ordering(partial_order(static_cast<_Tp&&>(__e),
@@ -808,9 +804,8 @@ namespace std
template<typename _Tp, __decayed_same_as<_Tp> _Up>
requires __strongly_ordered<_Tp, _Up> || __op_eq_lt<_Tp, _Up>
constexpr strong_ordering
- operator()(_Tp&& __e, _Up&& __f) const
+ operator() [[nodiscard]] (_Tp&& __e, _Up&& __f) const
noexcept(_S_noexcept<_Tp, _Up>())
- [[nodiscard]]
{
if constexpr (__strongly_ordered<_Tp, _Up>)
return _Strong_order{}(static_cast<_Tp&&>(__e),
@@ -841,9 +836,8 @@ namespace std
template<typename _Tp, __decayed_same_as<_Tp> _Up>
requires __weakly_ordered<_Tp, _Up> || __op_eq_lt<_Tp, _Up>
constexpr weak_ordering
- operator()(_Tp&& __e, _Up&& __f) const
+ operator() [[nodiscard]] (_Tp&& __e, _Up&& __f) const
noexcept(_S_noexcept<_Tp, _Up>())
- [[nodiscard]]
{
if constexpr (__weakly_ordered<_Tp, _Up>)
return _Weak_order{}(static_cast<_Tp&&>(__e),
@@ -884,9 +878,8 @@ namespace std
template<typename _Tp, __decayed_same_as<_Tp> _Up>
requires __partially_ordered<_Tp, _Up> || __op_eq_lt_lt<_Tp, _Up>
constexpr partial_ordering
- operator()(_Tp&& __e, _Up&& __f) const
+ operator() [[nodiscard]] (_Tp&& __e, _Up&& __f) const
noexcept(_S_noexcept<_Tp, _Up>())
- [[nodiscard]]
{
if constexpr (__partially_ordered<_Tp, _Up>)
return _Partial_order{}(static_cast<_Tp&&>(__e),
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-08-06 13:29 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-06 13:29 [gcc r12-2788] libstdc++: Also move the [[nodiscard]] attributes in <compare> Jonathan Wakely
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).