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()