c++: Expr pack expansion equality [pr94454]
authorNathan Sidwell <nathan@acm.org>
Mon, 20 Apr 2020 13:48:45 +0000 (06:48 -0700)
committerNathan Sidwell <nathan@acm.org>
Mon, 20 Apr 2020 13:48:45 +0000 (06:48 -0700)
commit7fcb93431ef18a31c9af142f77faa176bbd9b3dc
tree6e60d0d04b86933e0888c8deb3f85db1669e7546
parentaa576f2a860c8287cac6bbe6d37f5f37448bf06a
c++: Expr pack expansion equality [pr94454]

We were not comparing expression pack expansions correctly. We could
consider distinct expansions equal and creating two, apparently equal,
specializations that would sometimes collide.  cp_tree_operand_length
says a pack has 1 operand (for mangling), whereas it actually has 3,
but only two of which are significant for equality.  We must special
case that in cp_tree_equal.  That new code matches the hasher and the
type_pack_expansion case in structural_comp_types.

* tree.c (cp_tree_equal): [TEMPLATE_ID_EXPR, default] Refactor.
[EXPR_PACK_EXPANSION]: Add.
gcc/cp/ChangeLog
gcc/cp/tree.c