https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100037
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |accepts-invalid Last reconfirmed|2021-04-11 00:00:00 |2021-8-4 --- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Here shows what the problem is, the following should not be accepted but is: template <bool C> struct always_int{}; struct view { template <bool Const> struct iterator; template <bool C> struct iterator { always_int<C> inner = always_int<Const>(); }; }; ---- CUT ---- The forward declaration template argument is being used here. Note before GCC 4.9.0, GCC rejects both cases and even without the forward declaration. In GCC 4.9.0, GCC starts accepting without the forward declaration and started to accept the above code. Should we declare this as a regression for the accepts-invalid, I don't know.