From: Jonathan Wakely <jwakely@redhat.com>
To: "Seija K." <doremylover123@gmail.com>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
"libstdc++@gcc.gnu.org" <libstdc++@gcc.gnu.org>
Subject: Re: [PATCH] PR libstdc++/98842: Fixed Constraints on operator<=>(optional, U)
Date: Fri, 4 Jun 2021 21:41:11 +0100 [thread overview]
Message-ID: <CACb0b4=eCtxBujUUyVy-8ruahjYNCp0WDvZGGOYxYDJ9xhvJiA@mail.gmail.com> (raw)
In-Reply-To: <CAA42iKzcx9dfs8-jfEwicV+SCmpaMuRo--NP0dFQfiUca+cqZA@mail.gmail.com>
On Thu, 3 Jun 2021 at 17:27, Seija K. via Libstdc++ <libstdc++@gcc.gnu.org>
wrote:
> The original operator was underconstrained. _Up needs to fulfill
> compare_three_way_result,
> as mentioned in this bug report
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98842
>
Thanks, I'll get the patch applied next week.
> diff --git a/libstdc++-v3/include/std/optional
> b/libstdc++-v3/include/std/optional
> index 8b9e038e6e510..9e61c1b2cbfbd 100644
> --- a/libstdc++-v3/include/std/optional
> +++ b/libstdc++-v3/include/std/optional
> @@ -1234,7 +1234,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
> { return !__rhs || __lhs >= *__rhs; }
>
> #ifdef __cpp_lib_three_way_comparison
> - template<typename _Tp, typename _Up>
> + template<typename _Tp, three_way_comparable_with<_Tp> _Up>
> constexpr compare_three_way_result_t<_Tp, _Up>
> operator<=>(const optional<_Tp>& __x, const _Up& __v)
> { return bool(__x) ? *__x <=> __v : strong_ordering::less; }
>
>
next prev parent reply other threads:[~2021-06-04 20:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-03 16:25 Seija K.
2021-06-04 20:41 ` Jonathan Wakely [this message]
2021-06-07 15:29 ` Jonathan Wakely
2021-06-13 21:59 ` Seija K.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CACb0b4=eCtxBujUUyVy-8ruahjYNCp0WDvZGGOYxYDJ9xhvJiA@mail.gmail.com' \
--to=jwakely@redhat.com \
--cc=doremylover123@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=libstdc++@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).