public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/59931] Wrong wording of diagnostic about imaginary "member function type"
       [not found] <bug-59931-4@http.gcc.gnu.org/bugzilla/>
@ 2014-01-24  1:35 ` redi at gcc dot gnu.org
  2021-08-04  7:41 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 2+ messages in thread
From: redi at gcc dot gnu.org @ 2014-01-24  1:35 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59931

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to frankhb1989 from comment #0)
> The member 'C::f' here should have type 'void ()'(if it makes
> sense),

I don't think so, that would produce an even worse diagnostic if you tried to
convert 't' to a void (*)():

a.cc:6:21: error: cannot convert 'C::f' from type 'void ()' to type  'void
(*()'
   void (*pf)() = f;
                  ^
That would be worse, because void() to void(*)() _is_ a valid conversion, so we
really don't want to imply 'f' has that type and then have to say an apparently
valid conversion wasn't possible.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug c++/59931] Wrong wording of diagnostic about imaginary "member function type"
       [not found] <bug-59931-4@http.gcc.gnu.org/bugzilla/>
  2014-01-24  1:35 ` [Bug c++/59931] Wrong wording of diagnostic about imaginary "member function type" redi at gcc dot gnu.org
@ 2021-08-04  7:41 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-04  7:41 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-08-04
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
GCC:
<source>:6:35: error: cannot convert 'C::f' from type 'void (C::)()' to type
'void (C::*)()'


clang:
<source>:6:21: error: reference to non-static member function must be called;
did you mean to call it with no arguments?
<source>:6:13: error: cannot initialize a variable of type 'void (C::*)()' with
an rvalue of type 'void'

ICC:
<source>(6): error #547: nonstandard form for taking the address of a member
function

MSVC:
<source>(6): error C3867: 'C::f': non-standard syntax; use '&' to create a
pointer to member

Of these messages, I don't know which is the best, they all seems bad.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-04  7:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-59931-4@http.gcc.gnu.org/bugzilla/>
2014-01-24  1:35 ` [Bug c++/59931] Wrong wording of diagnostic about imaginary "member function type" redi at gcc dot gnu.org
2021-08-04  7:41 ` pinskia 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).