[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 19:52:00 GMT 2016


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

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
For comparison, clang gives a much clearer error:

77711.cc:11:9: error: reference to non-static member function must be called;
did you mean to call it with no arguments?
      x.f
      ~~^
         ()

It says *why* it's invalid (it must be called), and suggests adding an empty
argument list (including when the function has parameters but they have default
arguments).

I have a fix for PR77777 so we can print the same range info and fix-it as
clang does.


More information about the Gcc-bugs mailing list