On Fri, Dec 17, 2010 at 12:11 PM, H.J. Lu <hjl.to...@gmail.com> wrote:
> On Wed, Oct 27, 2010 at 7:24 AM, Dodji Seketeli <do...@redhat.com> wrote:
>> Hello,
>>
>> So I forgot to remove the wrong "optimization" on the parms of
>> template template parameters. In the patch at the end of this message
>> this hunks fixes that:
>>
> ...
>>
>> Below is the fully updated patch. Fully bootstrapped and tested on
>> x86_64-unknown-linux-gnu.
>>
>> --
>>        Dodji
>>
>> commit c21c5f024f47a9a55facbd70c0d1f36956cff7c4
>> Author: Dodji Seketeli <do...@redhat.com>
>> Date:   Mon Sep 13 12:12:21 2010 +0200
>>
>>    Restore canonical type comparison for dependent typedefs
>>
>>    gcc/cp/ChangeLog:
>>        PR c++/45606
>>        * cp-tree.h (TEMPLATE_TYPE_PARM_SIBLING_PARMS): Remove.
>>        (struct template_parm_index_s)<num_siblings>: New field.
>>        (TEMPLATE_PARM_NUM_SIBLINGS): New accessor.
>>        (process_template_parm): Extend the API to accept the number of
>>        template parms in argument.
>>        (cp_set_underlying_type): Remove this.
>>        * class.c (build_self_reference): Require canonical type equality
>>        back on the self reference of class.
>>        * decl2.c (grokfield): Require canonical type equality back on
>>        typedef class fields.
>>        * name-lookup.c (pushdecl_maybe_friend): Require canonical type
>>        equality back on typedefs.
>>        * parser.c (cp_parser_template_parameter_list): Do not require
>>        canonical type equality on dependent types created during
>>        template parameters parsing.
>>        * pt.c (fixup_template_type_parm_type, fixup_template_parm_index)
>>        (fixup_template_parm, fixup_template_parms): New private
>>        functions.
>>        (current_template_args): Declare this.
>>        (process_template_parm): Pass the total number of template parms
>>        to canonical_type_parameter.
>>        (build_template_parm_index): Add a new argument to carry the total
>>        number of template parms.
>>        (reduce_template_parm_level, process_template_parm, make_auto): 
>> Adjust.
>>        (current_template_args): Fix this for template template
>>        parameters.
>>        (tsubst_template_parm): Split out of ...
>>        (tsubst_template_parms): ... this.
>>        (reduce_template_parm_level): Don't loose
>>        TEMPLATE_PARM_NUM_SIBLINGS when cloning a TEMPLATE_PARM_INDEX.
>>        (template_parm_to_arg): Extracted this function from
>>        current_template_args. Make it represent invalid template parms
>>        with an error_mark_node instead of a LIST_TREE containing an
>>        error_mark_node.
>>        (current_template_args): Use template_parm_to_arg.
>>        (dependent_template_arg_p): Consider an invalid template argument
>>        as dependent.
>>        (end_template_parm_list): Do not update template sibling parms
>>        here anymore. Use fixup_template_parms instead.
>>        (process_template_parm): Pass the number of template parms to
>>        canonical_type_parameter.
>>        (make_auto): Require structural equality on auto
>>        TEMPLATE_TYPE_PARM for now.
>>        (unify)<BOUND_TEMPLATE_TEMPLATE_PARM>: Coerce template parameters
>>        using all the arguments deduced so far.
>>        (tsubst)<TEMPLATE_TYPE_PARM>: Pass the number of sibling parms to
>>        canonical_type_parameter.
>>        * tree.c (cp_set_underlying_type): Remove.
>>        * typeck.c (get_template_parms_of_dependent_type)
>>        (incompatible_dependent_types_p): Remove.
>>        (structural_comptypes): Do not call incompatible_dependent_types_p
>>        anymore.
>>        (comp_template_parms_position): Re-organized. Take the length of
>>        template parms list in account.
>>
>>    gcc/testsuite/ChangeLog:
>>        PR c++/45606
>>        * g++.dg/template/typedef36.C: New test.
>>        * gcc/testsuite/g++.dg/template/canon-type-9.C: Likewise.
>>        * g++.dg/template/canon-type-10.C: Likewise.
>>        * g++.dg/template/canon-type-11.C: Likewise.
>>        * g++.dg/template/canon-type-12.C: Likewise.
>>        * g++.dg/template/canon-type-13.C: Likewise.
>>
>
>
> This caused:
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46394
>

It also caused:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50870

-- 
H.J.

Reply via email to