https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64825
--- Comment #2 from Eric Gallager <egallager at gcc dot gnu.org> --- (In reply to Eric Gallager from comment #1) > Confirmed that gcc doesn't warn, although my version of clang is older so it > doesn't warn either. Still, would be nice to have. Now that I'm on a different computer with a newer version of clang, I can confirm that current clang prints the warning you said it did, too.