-
- Downloads
c++: Template argument hashing [pr94454]
One of the problems hit by pr94454 was that the argument hasher was not skipping nodes that template_args_equal would. Fixed by replacing the STRIP_NOPS invocation by a bespoke loop. We also confuse the canonical type machinery by treating tpl-tpl-parms as types. They're not; bound-tpl-tpl-parms are. We can get away with them being type-like. Unfortunately we give the original level==orig_level case a canonical type, but the reduced cases of level<orig_level get structural equality. That breaks the hasher because we'll use TYPE_HASH (CANONICAL_TYPE ()) when we can. There's a note in tsubst[TEMPLATE_TEMPLATE_PARM] about why the reduced ones cannot have a canonical type. (I didn't feel like questioning that assertion at this point.) * pt.c (iterative_hash_template_arg): Strip nodes as template_args_equal does. [ARGUMENT_PACK_SELECT, TREE_VEC, CONSTRUCTOR]: Refactor. [node_class:TEMPLATE_TEMPLATE_PARM]: Hash by level & index. [node_class:default]: Refactor.
Loading
Please register or sign in to comment