https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97988
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever confirmed|0 |1 Keywords| |ice-on-invalid-code Depends on| |12944 Last reconfirmed| |2021-08-17 --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- It seems like it is creating a struct D with the template argument in the global namespace. If I add struct D; at the very begining of the file, it all works. Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=12944 [Bug 12944] [meta-bug] C++ name-lookup problems