https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84892
Bug ID: 84892 Summary: Missing accessor hint for private field Product: gcc Version: 8.0 Status: UNCONFIRMED Keywords: diagnostic Severity: normal Priority: P3 Component: c++ Assignee: dmalcolm at gcc dot gnu.org Reporter: dmalcolm at gcc dot gnu.org Target Milestone: --- Reddit user "evaned" reports that we fail to offer a fix-it hint code suggesting the "get_field" accessor on this code: https://godbolt.org/g/y2cbuv class S { private: bool field; public: bool get_field() const { return field; } }; bool thingy(const S & s) { return s.field; } Removing the "const" from "thingy" seems to fix it.