c++: simplify TEMPLATE_TYPE_PARM level lowering
commitafc7e20e793ce4071a7fe593ccebb2e6b2b070fa
authorPatrick Palka <ppalka@redhat.com>
Thu, 20 Apr 2023 19:16:59 +0000 (20 15:16 -0400)
committerPatrick Palka <ppalka@redhat.com>
Thu, 20 Apr 2023 19:16:59 +0000 (20 15:16 -0400)
tree432fccaeea5eba1244395651403b43769b724448
parent76fa66ea397cb255ab1d68a90ff6b878236e9620
c++: simplify TEMPLATE_TYPE_PARM level lowering

1. Don't bother recursing when level lowering a cv-qualified type
   template parameter.
2. Get rid of the recursive loop breaker when level lowering a
   constrained auto, and enable the TEMPLATE_PARM_DESCENDANTS cache in
   this case too.  This should be safe to do so now that we no longer
   substitute constraints on an auto.

gcc/cp/ChangeLog:

* pt.cc (tsubst) <case TEMPLATE_TYPE_PARM>: Don't recurse when
level lowering a cv-qualified type template parameter.  Remove
recursive loop breaker in the level lowering case for constrained
autos.  Use the TEMPLATE_PARM_DESCENDANTS cache in this case as
well.
gcc/cp/pt.cc