aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/ChangeLog
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2019-08-12 17:46:25 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2019-08-12 17:46:25 +0000
commit2ce7d7b997467acbd781d7ea98a54bbcebcf71e2 (patch)
treea5492d7aa2cc13facd4ed9e1dc17c2d07e7417e0 /gcc/cp/ChangeLog
parenteae3c7b5dd0fdd336ea47e09a2319372217281ee (diff)
PR c++/90538 - multiple expansions of capture packs
Previously, with init-capture the type of the closure field was a DECLTYPE_TYPE of the initializer. But since each time we tsubst a lambda we get a different lambda, that meant that if the initializer is a lambda, we'd end up with different closure types in the field and initializer after substitution (PR 87322). We dealt with this by remembering the lambda instantiation within each pack expansion element, using local_specialization_stack to separate the elements. But that broke this testcase, because it lost lambda capture proxies that also use local_specializations. So, this patch removes the local_specializations changes from that patch and fixes 87322 differently, by giving init-capture fields 'auto' type and doing deduction later. There's a bit of a kludge to get the right number of fields by pretending that 'auto...' uses the parameter packs from the initializer, but it does the trick. * cp-tree.h (DECLTYPE_FOR_INIT_CAPTURE): Remove. * lambda.c (add_capture): Copy parameter packs from init. (lambda_capture_field_type): Always use auto for init-capture. * pt.c (uses_parameter_packs): Return tree. (tsubst) [DECLTYPE_TYPE]: Remove init-capture handling. (gen_elem_of_pack_expansion_instantiation): Don't push local_specialization_stack. (prepend_one_capture): New. (tsubst_lambda_expr): Use it. Don't touch local_specializations. (do_auto_deduction): Avoid redundant error. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-9-branch@274315 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/ChangeLog')
-rw-r--r--gcc/cp/ChangeLog14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index c977850d067..9a34a4f128e 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,17 @@
+2019-08-12 Jason Merrill <jason@redhat.com>
+
+ PR c++/90538 - multiple expansions of capture packs
+ * cp-tree.h (DECLTYPE_FOR_INIT_CAPTURE): Remove.
+ * lambda.c (add_capture): Copy parameter packs from init.
+ (lambda_capture_field_type): Always use auto for init-capture.
+ * pt.c (uses_parameter_packs): Return tree.
+ (tsubst) [DECLTYPE_TYPE]: Remove init-capture handling.
+ (gen_elem_of_pack_expansion_instantiation): Don't push
+ local_specialization_stack.
+ (prepend_one_capture): New.
+ (tsubst_lambda_expr): Use it. Don't touch local_specializations.
+ (do_auto_deduction): Avoid redundant error.
+
2019-08-12 Release Manager
* GCC 9.2.0 released.