[Bug c++/77711] New: Add fix-it hints for missing parentheses in member function call
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Sep 23 15:31:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77711
Bug ID: 77711
Summary: Add fix-it hints for missing parentheses in member
function call
Product: gcc
Version: 7.0
Status: UNCONFIRMED
Keywords: diagnostic
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: redi at gcc dot gnu.org
Target Milestone: ---
struct A {
int foo() { return 0; }
};
void bar(int);
int main()
{
A a;
bar( a.foo );
}
This gives:
foo.cc: In function ‘int main()’:
foo.cc:10:14: error: invalid use of non-static member function ‘int A::foo()’
bar( a.foo );
^
foo.cc:2:7: note: declared here
int foo() { return 0; }
^~~
It should suggest changing it to a.foo()
More information about the Gcc-bugs
mailing list