https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77298
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Different warnings are simply done at different compilation phases. This is similar to how you get only a subset of FE warnings on uninstantiated templates, only something can be warned reliably at that phase, and something is just too hard to warn at that phase. So, lots of warnings you get only when actually instantiating the templates.