From: Patrick Palka Date: Sat, 3 Jun 2023 13:22:52 +0000 (-0400) Subject: c++: simplify TEMPLATE_TEMPLATE_PARM hashing X-Git-Tag: basepoints/gcc-15~8621 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=23bee8508816297a9b2ab81a96aa0c79ac88ceba;p=thirdparty%2Fgcc.git c++: simplify TEMPLATE_TEMPLATE_PARM hashing r10-7815-gaa576f2a860c82 added special hashing for TEMPLATE_TEMPLATE_PARM to work around non-lowered ttps having TYPE_CANONICAL set but lowered ttps did not. But ever since r13-737-gd0ef9e06197d14 this is no longer the case, and all ttps should now have TYPE_CANONICAL set. So this special hashing is now unnecessary and we can fall back to always using TYPE_CANONICAL. gcc/cp/ChangeLog: * pt.cc (iterative_hash_template_arg): Don't hash TEMPLATE_TEMPLATE_PARM specially. --- diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc index 244b0b034545..dae3815f62a9 100644 --- a/gcc/cp/pt.cc +++ b/gcc/cp/pt.cc @@ -1879,19 +1879,8 @@ iterative_hash_template_arg (tree arg, hashval_t val) return hash_tmpl_and_args (TI_TEMPLATE (ti), TI_ARGS (ti)); } - switch (TREE_CODE (arg)) + switch (code) { - case TEMPLATE_TEMPLATE_PARM: - { - tree tpi = TEMPLATE_TYPE_PARM_INDEX (arg); - - /* Do not recurse with TPI directly, as that is unbounded - recursion. */ - val = iterative_hash_object (TEMPLATE_PARM_LEVEL (tpi), val); - val = iterative_hash_object (TEMPLATE_PARM_IDX (tpi), val); - } - break; - case DECLTYPE_TYPE: val = iterative_hash_template_arg (DECLTYPE_TYPE_EXPR (arg), val); break;