public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jason Merrill <jason@redhat.com>
To: Patrick Palka <ppalka@redhat.com>, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH v2 3/3] c++: note other candidates when diagnosing deletedness
Date: Tue, 24 Oct 2023 17:56:04 -0400	[thread overview]
Message-ID: <775dc7c2-5ab4-4aee-9854-948a27c5c261@redhat.com> (raw)
In-Reply-To: <20231023235154.2971561-3-ppalka@redhat.com>

On 10/23/23 19:51, Patrick Palka wrote:
> With the previous two patches in place, we can now extend our
> deletedness diagnostic to note the other considered candidates, e.g.:
> 
>    deleted16.C: In function 'int main()':
>    deleted16.C:10:4: error: use of deleted function 'void f(int)'
>       10 |   f(0);
>          |   ~^~~
>    deleted16.C:5:6: note: declared here
>        5 | void f(int) = delete;
>          |      ^
>    deleted16.C:5:6: note: candidate: 'void f(int)' (deleted)
>    deleted16.C:6:6: note: candidate: 'void f(...)'
>        6 | void f(...);
>          |      ^
>    deleted16.C:7:6: note: candidate: 'void f(int, int)'
>        7 | void f(int, int);
>          |      ^
>    deleted16.C:7:6: note:   candidate expects 2 arguments, 1 provided
> 
> For now, these these notes are disabled when a deleted special member
> function is selected because it introduces a lot of new "cannot bind
> reference" errors in the testsuite when noting non-viable candidates,
> e.g. in cpp0x/initlist-opt1.C we would need to expect an error when
> noting unviability of A(A&&).  (It'd be nice if we could downgrade such
> errors into notes when noting candidates...)

What about my suggestion to make printing the other candidates an 
opt-in, with the normal output just suggesting the use of that option 
for more information, like -ftemplate-backtrace-limit?

Jason


  reply	other threads:[~2023-10-24 21:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-23 23:51 [PATCH v2 1/3] c++: sort candidates according to viability Patrick Palka
2023-10-23 23:51 ` [PATCH v2 2/3] c++: remember candidates that we ignored Patrick Palka
2023-10-24 21:51   ` Jason Merrill
2023-10-23 23:51 ` [PATCH v2 3/3] c++: note other candidates when diagnosing deletedness Patrick Palka
2023-10-24 21:56   ` Jason Merrill [this message]
2023-10-24 21:28 ` [PATCH v2 1/3] c++: sort candidates according to viability Jason Merrill

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=775dc7c2-5ab4-4aee-9854-948a27c5c261@redhat.com \
    --to=jason@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=ppalka@redhat.com \
    /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).