[Bug c++/64961] nested template implementation crossing namespace fails with access error

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Dec 10 07:35:24 GMT 2021


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64961

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2021-12-10

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed. I think GCC is doing access checks too soon in this case. 

For a function definition, I don't think access checking applies.

bar::Bar::Ba::Fo::foo is the same as
Foo<1>::Fo::foo which should be valid to define in the foo namespace.
ICC, clang and MSVC all accept the code.


More information about the Gcc-bugs mailing list