public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/82594] Please provide better parameter / argument mismatch warnings/notes for no overloads case
       [not found] <bug-82594-4@http.gcc.gnu.org/bugzilla/>
@ 2023-10-30 14:23 ` redi at gcc dot gnu.org
  0 siblings, 0 replies; only message in thread
From: redi at gcc dot gnu.org @ 2023-10-30 14:23 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=112293

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #1)
> But with only one overload, GCC produces:
> t88.c: In function 'void initialize()':
> t88.c:13:35: error: cannot convert 'void (*)(S2*)' to 'S1*' for argument '1'
> to 'void set_delete_thread(S1*, void (*)(S2*))'
>    set_delete_thread (delete_thread);
>                                    ^

This is pretty bad. Why do we complain about not being able to convert the
argument, when the bigger problem is that the number of arguments is wrong? It
doesn't matter whether the first argument matches or not, the other two args
are missing.

For the example in PR 112293 it would have been much better to point out that
the only visible overload of std::remove expects one argument instead of the
irrelevant diagnostic about converting vector<T*>::iterator to const char*.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-10-30 14:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-82594-4@http.gcc.gnu.org/bugzilla/>
2023-10-30 14:23 ` [Bug c++/82594] Please provide better parameter / argument mismatch warnings/notes for no overloads case redi at gcc dot gnu.org

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).