]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c++: simplify TEMPLATE_TEMPLATE_PARM hashing
authorPatrick Palka <ppalka@redhat.com>
Sat, 3 Jun 2023 13:22:52 +0000 (09:22 -0400)
committerPatrick Palka <ppalka@redhat.com>
Sat, 3 Jun 2023 13:22:52 +0000 (09:22 -0400)
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.

gcc/cp/pt.cc

index 244b0b034545ece2c49db6878c3658e54cfafc9a..dae3815f62a97e670b92afe510817394b8f8124a 100644 (file)
@@ -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;