aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2022-06-22 21:29:16 -0400
committerJason Merrill <jason@redhat.com>2022-06-22 23:23:01 -0400
commit27e9bd911626b6ae336fc62c86da5ff710de39ab (patch)
tree05a8c086f2e51cadbdac1829a1e7c58aa0134e81 /gcc/cp
parentd29f61a3291a8c4cff0bd754fa3bb8e9399589bc (diff)
downloadgcc-27e9bd911626b6ae336fc62c86da5ff710de39ab.zip
gcc-27e9bd911626b6ae336fc62c86da5ff710de39ab.tar.gz
gcc-27e9bd911626b6ae336fc62c86da5ff710de39ab.tar.bz2
c++: tweak deduction with auto template parms
While looking at PR105964 I noticed that we were unnecessarily repeating the deduction loop because of seeing a non-type parameter with type 'auto'. It is indeed dependent, but not on any other deductions. gcc/cp/ChangeLog: * pt.cc (type_unification_real): An auto tparm can't be affected by other deductions.
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/pt.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc
index 4d1c325..80d2bec 100644
--- a/gcc/cp/pt.cc
+++ b/gcc/cp/pt.cc
@@ -22982,6 +22982,7 @@ type_unification_real (tree tparms,
deduced from a later argument than the one from which
this parameter can be deduced. */
if (TREE_CODE (tparm) == PARM_DECL
+ && !is_auto (TREE_TYPE (tparm))
&& uses_template_parms (TREE_TYPE (tparm))
&& saw_undeduced < 2)
{
@@ -23042,6 +23043,7 @@ type_unification_real (tree tparms,
if (saw_undeduced == 1
&& TREE_CODE (parm) == PARM_DECL
+ && !is_auto (TREE_TYPE (parm))
&& uses_template_parms (TREE_TYPE (parm)))
{
/* The type of this non-type parameter depends on undeduced