[Bug c++/100037] lookup doesn't find class template parameter in default member initializer of forward declared nested class template

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Aug 4 18:22:47 GMT 2021


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.


More information about the Gcc-bugs mailing list