aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/lambda.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2018-02-11 20:21:39 -0500
committerJason Merrill <jason@gcc.gnu.org>2018-02-11 20:21:39 -0500
commitdc58fa9f3142097bbcf2d60212041d08ab16cd8e (patch)
tree6015b7020be9ee3d06dffafcd87f625e23b96749 /gcc/cp/lambda.c
parentf1ea257f3cda1f04a64a4046f77013727693eb70 (diff)
downloadgcc-dc58fa9f3142097bbcf2d60212041d08ab16cd8e.zip
gcc-dc58fa9f3142097bbcf2d60212041d08ab16cd8e.tar.gz
gcc-dc58fa9f3142097bbcf2d60212041d08ab16cd8e.tar.bz2
PR c++/84036 - ICE with variadic capture.
Handle variadic capture proxies more like non-variadic. * lambda.c (build_capture_proxy): Remove workaround. * pt.c (find_parameter_packs_r): The proxy is a pack. (instantiate_class_template_1): Remove dead lambda code. (extract_fnparm_pack): Don't make_pack_expansion. (extract_locals_r): Don't strip a pack expansion. (tsubst_pack_expansion): Handle proxy packs. Use PACK_EXPANSION_EXTRA_ARGS less. (tsubst_decl) [FIELD_DECL]: Don't register_specialization. (tsubst_copy) [FIELD_DECL]: Don't retrieve*_specialization. [VAR_DECL]: Handle ARGUMENT_PACK_SELECT. (tsubst_expr) [DECL_EXPR]: Handle proxy packs. (tsubst_copy_and_build) [VAR_DECL]: Handle proxy packs normally. From-SVN: r257575
Diffstat (limited to 'gcc/cp/lambda.c')
-rw-r--r--gcc/cp/lambda.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/gcc/cp/lambda.c b/gcc/cp/lambda.c
index 2545eae..6b5bd80 100644
--- a/gcc/cp/lambda.c
+++ b/gcc/cp/lambda.c
@@ -455,19 +455,11 @@ build_capture_proxy (tree member, tree init)
STRIP_NOPS (init);
}
- if (TREE_CODE (init) == COMPONENT_REF)
- /* We're capturing a capture of a function parameter pack, and have
- lost track of the original variable. It's not important to have
- DECL_CAPTURED_VARIABLE in this case, since a function parameter pack
- isn't a constant variable, so don't bother trying to set it. */;
- else
- {
- gcc_assert (VAR_P (init) || TREE_CODE (init) == PARM_DECL);
- while (is_normal_capture_proxy (init))
- init = DECL_CAPTURED_VARIABLE (init);
- retrofit_lang_decl (var);
- DECL_CAPTURED_VARIABLE (var) = init;
- }
+ gcc_assert (VAR_P (init) || TREE_CODE (init) == PARM_DECL);
+ while (is_normal_capture_proxy (init))
+ init = DECL_CAPTURED_VARIABLE (init);
+ retrofit_lang_decl (var);
+ DECL_CAPTURED_VARIABLE (var) = init;
}
if (name == this_identifier)