This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]