From: Jason Merrill Date: Mon, 17 Aug 2015 18:42:09 +0000 (-0400) Subject: re PR c++/67244 (internal compiler error: in gimplify_var_or_parm_decl, at gimplify... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b361a15ff60daf83fc2ddccbc6166e4bd19e2b35;p=gcc.git re PR c++/67244 (internal compiler error: in gimplify_var_or_parm_decl, at gimplify.c:1801) PR c++/67244 * pt.c (tsubst_copy_and_build): Call insert_pending_capture_proxies. From-SVN: r226950 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 078ee74f9f7..ca00d03e11d 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2015-08-17 Jason Merrill + PR c++/67244 + * pt.c (tsubst_copy_and_build): Call insert_pending_capture_proxies. + PR c++/67104 * constexpr.c (array_index_cmp, find_array_ctor_elt): New. (cxx_eval_array_reference, cxx_eval_store_expression): Use them. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index ecd86e4397f..b84bda47fd1 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -16344,6 +16344,8 @@ tsubst_copy_and_build (tree t, LAMBDA_EXPR_THIS_CAPTURE (r) = NULL_TREE; + insert_pending_capture_proxies (); + RETURN (build_lambda_object (r)); } diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-nested5.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-nested5.C new file mode 100644 index 00000000000..3ebdf3b36ae --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-nested5.C @@ -0,0 +1,29 @@ +// PR c++/67244 +// { dg-do compile { target c++11 } } + +class A { +public: + int operator*(); +}; +template +void searchGen(int, int, T, Predicate p4) { + p4(0); +} +template struct B; +template +struct B { + static void exec() { MetaFunction::template exec; } +}; +template void forEachType() { + B::exec; +} +namespace { +struct C { + template void exec() { + A __trans_tmp_1; + const auto target = *__trans_tmp_1; + searchGen(0, 0, 0, [=](T) { [=] { target; }; }); + } +}; +} +void ____C_A_T_C_H____T_E_S_T____75() { forEachType; }