aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Palka <ppalka@redhat.com>2023-06-03 09:22:52 -0400
committerPatrick Palka <ppalka@redhat.com>2023-06-03 09:22:52 -0400
commit23bee8508816297a9b2ab81a96aa0c79ac88ceba (patch)
tree83612da961bd173ab607a9107c93bf89d584ef61
parent557cc2b721432775a12fcafa60e9b8b0c320c29d (diff)
downloadgcc-23bee8508816297a9b2ab81a96aa0c79ac88ceba.zip
gcc-23bee8508816297a9b2ab81a96aa0c79ac88ceba.tar.gz
gcc-23bee8508816297a9b2ab81a96aa0c79ac88ceba.tar.bz2
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.
-rw-r--r--gcc/cp/pt.cc13
1 files changed, 1 insertions, 12 deletions
diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc
index 244b0b0..dae3815 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;