[Bug c++/85523] New: Add fix-it hint for missing return statement in assignment operators
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Apr 25 17:38:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85523
Bug ID: 85523
Summary: Add fix-it hint for missing return statement in
assignment operators
Product: gcc
Version: 8.0
Status: UNCONFIRMED
Keywords: diagnostic
Severity: enhancement
Priority: P3
Component: c++
Assignee: dmalcolm at gcc dot gnu.org
Reporter: redi at gcc dot gnu.org
Target Milestone: ---
As discussed at https://gcc.gnu.org/ml/gcc/2018-04/msg00170.html we could offer
fix-it hints for cases like:
struct X {
X& operator=(const X&) { } // show fix-it
};
struct Y {
void operator=(const Y&) { }
int operator=(int) { } // no fix-it here, just a -Wreturn-type warning
};
struct Z {
Z& operator=(const Z& z) {
i = z.i;
} // show fix-it
int i;
};
More information about the Gcc-bugs
mailing list