https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109083
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org,
| |jason at gcc dot gnu.org,
| |ppalka at gcc dot gnu.org
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
What happens is that finish_template_type is called once from unused_function
with
is_member_function_pointer TEMPLATE_DECL as name and args
<tree_vec 0x7fffea2fd2e0 length:1
elt:0 <decltype_type 0x7fffea2fc930 VOID
align:8 warn_if_not_align:0 symtab:0 alias-set -1 structural-equality
expr <addr_expr 0x7fffea2fd2c0 type <dependent_operator_type
0x7fffea2fc888>
arg:0 <scope_ref 0x7fffea2fbd20 tree_0 arg:0 <template_type_parm
0x7fffea2fc738 T>
arg:1 <identifier_node 0x7fffea2e9cc0 foo
normal local bindings <(nil)>>
pr109083.ii:86:64 start: pr109083.ii:86:64 finish:
pr109083.ii:86:66>
pr109083.ii:86:60 start: pr109083.ii:86:60 finish:
pr109083.ii:86:66>>>
(in my case of reduced preprocessed source), calls lookup_template_class, finds
nothing in
9943 entry = type_specializations->find_with_hash (&elt, hash);
and so creates
10082 t = make_class_type (TREE_CODE (template_type));
etc.
Next time finish_template_type is called from fail_here with the same
TEMPLATE_DECL as name and args
<tree_vec 0x7fffea2fd400 length:1
elt:0 <decltype_type 0x7fffea2fcf18 VOID
align:8 warn_if_not_align:0 symtab:0 alias-set -1 structural-equality
expr <addr_expr 0x7fffea2fd3e0 type <dependent_operator_type
0x7fffea2fce70>
arg:0 <scope_ref 0x7fffea302000 tree_0 arg:0 <template_type_parm
0x7fffea2fcd20 T>
arg:1 <identifier_node 0x7fffea2e9cc0 foo
normal local bindings <(nil)>>
pr109083.ii:92:64 start: pr109083.ii:92:64 finish:
pr109083.ii:92:66>
pr109083.ii:92:60 start: pr109083.ii:92:60 finish:
pr109083.ii:92:66>>>
but this type the previously created specialization from unused_function is
returned.
So, shall template_args_equal or whatever it calls be changed so that it
doesn't consider these to be equal? If so, what compilation memory effects
will it have?