This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/77711] Add fix-it hints for missing parentheses in member function call
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 23 Sep 2016 15:34:15 +0000
- Subject: [Bug c++/77711] Add fix-it hints for missing parentheses in member function call
- Auto-submitted: auto-generated
- References: <bug-77711-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77711
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2016-09-23
Ever confirmed|0 |1
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
If the function is overloaded we get a different, equally unhelpful error:
struct A {
int foo();
int foo() const;
};
void bar(int);
int main()
{
A a;
bar( a.foo );
}
foo.cc: In function ‘int main()’:
foo.cc:11:14: error: cannot resolve overloaded function ‘foo’ based on
conversion to type ‘int’
bar( a.foo );
^
It's irrelevant that we can't resolve which overload to use, once name lookup
finds that 'foo' is a function then a.foo is not a valid expression under any
circumstances.
This should also suggest a.foo()