[Bug c++/77711] Add fix-it hints for missing parentheses in member function call

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Sep 28 20:03:00 GMT 2016


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

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Yet another variation on missing argument list for a member function call:

call.cc: In function ‘int main()’:
call.cc:20:14: error: cannot convert ‘A::foo’ from type ‘int (A::)()’ to type
‘int (A::*)()’
   auto x = a.foo;
              ^~~

Another completely different error, that's also pretty unhelpful. This should
probably use invalid_nonstatic_memfn_p too.

Clang gives exactly the same error in this case as for the bar( a.foo ) case,
which is much better than two different unclear messages.


More information about the Gcc-bugs mailing list