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

Reply via email to