public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-1211] c++: tweak deduction with auto template parms
@ 2022-06-23  3:23 Jason Merrill
  0 siblings, 0 replies; only message in thread
From: Jason Merrill @ 2022-06-23  3:23 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:27e9bd911626b6ae336fc62c86da5ff710de39ab

commit r13-1211-g27e9bd911626b6ae336fc62c86da5ff710de39ab
Author: Jason Merrill <jason@redhat.com>
Date:   Wed Jun 22 21:29:16 2022 -0400

    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.

Diff:
---
 gcc/cp/pt.cc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc
index 4d1c325432d..80d2bec2348 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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-06-23  3:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-23  3:23 [gcc r13-1211] c++: tweak deduction with auto template parms Jason Merrill

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).