https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79082
--- Comment #10 from Martin Sebor <msebor at gcc dot gnu.org> --- Only three out of the five patches for bug 78703 have been committed. I'm still waiting for approval of the substantive patch 4, and patch 5 depends on it. With those committed I think the warning should behave close to how you expect. I suspect it will still need some fine tuning after GCC 7 is released.