https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68423
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- You get an error as soon as you instantiate the templates. I don't know if the standard requires an error even for uninstantiated templates, but there are LOTS of things g++ doesn't diagnose in uninstantiated templates.