https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87408
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2018-09-24 Ever confirmed|0 |1 --- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- Our warning talks about the statement, and without interprocedural analysis it can't see that get() doesn't have an effect. Clang's warning is better because it doesn't say anything about whether get() has an effect, just that get()->a doesn't use the result of the class member access.