https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96746
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> --- What Marek explained is that your testcase is buggy, but it may or may not be diagnosed, unless the template is instantiated. If you instantiate such template, it has to be rejected by all implementations, but when only performing semantic analysis of uninstantiated templates, different implementations will report different sets of bugs, some are easier to diagnose in some implementations, others in different ones.