public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/106644] [C++23] P2468R2 - The Equality Operator You Are Looking For
Date: Tue, 25 Oct 2022 11:34:07 +0000	[thread overview]
Message-ID: <bug-106644-4-roOjTAXzSK@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-106644-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106644

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 53770
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53770&action=edit
gcc13-pr106644-wip.patch

Untested WIP.
Compared to vanilla trunk, this rejects the f2 case which is a2 from the
example in the standard.  But doesn't handle anything else unfortunately.
In the g1 case (c1 from the example in the standard), it is accepted for a
wrong reason, decls_match rejects the comparison between B::operator== and
C::operator!= because they have different CP_DECL_CONTEXT and so we think that
the operator== is a rewrite target when it is not.  Shall we use
something different than decls_match (say a copy of it that ignores the context
and for non-static members the this type too)?
The reason it is then accepted is some non-standard handling of the
rewritten/reversed candidates in joust?
Then g2 case (c2 in the standard) is then incorrectly accepted because of that
code in joust or so.
Not really sure if we have a way to search just in a single namespace and not
all the containing ones, and not sure about the using decls if those are
something that should be ignored like in the patch or handled too.
The k case in the testcase is I think because of joust too.
The u3 case in the testcase is I think about whether using decls count or not.
Anyway, the remaining // ERR cases are where clang++ trunk rejects stuff but we
with the patch don't.

  parent reply	other threads:[~2022-10-25 11:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-16 16:27 [Bug c++/106644] New: " mpolacek at gcc dot gnu.org
2022-10-22 12:54 ` [Bug c++/106644] " jakub at gcc dot gnu.org
2022-10-22 12:57 ` jakub at gcc dot gnu.org
2022-10-22 13:11 ` jakub at gcc dot gnu.org
2022-10-25 11:34 ` jakub at gcc dot gnu.org [this message]
2022-11-04 19:37 ` jason at gcc dot gnu.org
2022-11-08  1:37 ` mpolacek at gcc dot gnu.org
2022-11-28 22:15 ` pinskia at gcc dot gnu.org

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=bug-106644-4-roOjTAXzSK@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).