public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-53] c++: lambda capture dependent type [PR82980]
@ 2022-04-29 21:24 Jason Merrill
  0 siblings, 0 replies; only message in thread
From: Jason Merrill @ 2022-04-29 21:24 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:53e7252140c95afc859ade521a61ab4115d7fb11

commit r13-53-g53e7252140c95afc859ade521a61ab4115d7fb11
Author: Jason Merrill <jason@redhat.com>
Date:   Thu Apr 14 14:09:13 2022 -0400

    c++: lambda capture dependent type [PR82980]
    
    The stage 4 patch limited direct propagation of dependent type to capture
    field/proxy to the "current instantiation", but many more types should be
    suitable as well.
    
            PR c++/82980
    
    gcc/cp/ChangeLog:
    
            * lambda.cc (type_deducible_expression_p): Allow more types.

Diff:
---
 gcc/cp/lambda.cc | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/gcc/cp/lambda.cc b/gcc/cp/lambda.cc
index 65579edc316..10834d6b143 100644
--- a/gcc/cp/lambda.cc
+++ b/gcc/cp/lambda.cc
@@ -195,10 +195,9 @@ type_deducible_expression_p (tree expr)
       || TREE_CODE (expr) == EXPR_PACK_EXPANSION)
     return false;
   tree t = non_reference (TREE_TYPE (expr));
-  if (!t) return false;
-  while (TREE_CODE (t) == POINTER_TYPE)
-    t = TREE_TYPE (t);
-  return currently_open_class (t);
+  return (t && TREE_CODE (t) != TYPE_PACK_EXPANSION
+	  && !WILDCARD_TYPE_P (t) && !LAMBDA_TYPE_P (t)
+	  && !type_uses_auto (t));
 }
 
 /* Returns the type to use for the FIELD_DECL corresponding to the


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

only message in thread, other threads:[~2022-04-29 21:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-29 21:24 [gcc r13-53] c++: lambda capture dependent type [PR82980] 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).