[Bug c++/122634] error: keyword 'typename' not allowed outside of templates (reflection)

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Nov 11 22:52:02 GMT 2025


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I think the B and C cases should be accepted and D rejected.  GCC currently
rejects B-D, clang++ none.
struct A {};
namespace N { struct A {}; }
struct B : typename [: ^^A :] {};
struct C : [: ^^A :] {};
struct D : typename [: ^^N :] :: A {}; // { dg-error "" }
struct E : [: ^^N :] :: A {};


More information about the Gcc-bugs mailing list