https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64329
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Jonathan Wakely from comment #2) > (In reply to Michael Stahl from comment #1) > > i believe i've hit the same problem > > I don't think so. The original bug report is for 4.9.3, and seems to be an > actual compiler bug that is fixed already in GCC 5 and later. > > Your case is invalid code. While I agree a warning would be nice, it's not > the same as a bug in 4.9.3 that has been fixed. I've created PR 70692 for the missing warning on the invalid code, since it's a different problem to the one in this PR.