This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/77711] New: 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:30:56 +0000
- Subject: [Bug c++/77711] New: Add fix-it hints for missing parentheses in member function call
- Auto-submitted: auto-generated
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()