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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Makes me wonder if the bug isn't that we pass a TYPE_DECL rather than
IDENTIFIER_NODE to build_typename_type.  So perhaps:
--- gcc/cp/parser.cc.jj 2025-12-17 15:21:21.045719368 +0100
+++ gcc/cp/parser.cc    2025-12-18 11:11:56.074952675 +0100
@@ -20435,7 +20435,7 @@ cp_parser_template_id (cp_parser *parser
                                   fullname, arguments);
       TREE_TYPE (templ)
        = build_typename_type (TYPE_CONTEXT (TREE_TYPE (templ)),
-                              TYPE_NAME (TREE_TYPE (templ)),
+                              TYPE_IDENTIFIER (TREE_TYPE (templ)),
                               fullname,
                               get_typename_tag (TREE_TYPE (templ)));
       template_id = templ;
?

Reply via email to