Created attachment 36192 [details] The preprocessed source Internal compiler error with GCC 5.2.0 when building the attached preprocessed source on OS X 10.10.2: build_gcc❯ g++-5 -std=c++11 Unique.pp.cpp -o test rapidcheck/git/dev ../test/gen/ContainerTests/Unique.cpp: In lambda function: ../test/gen/ContainerTests/Unique.cpp:59:37: internal compiler error: in gimplify_var_or_parm_decl, at gimplify.c:1801 return std::count_if(begin(elements), ^ ../test/gen/ContainerTests/Unique.cpp:59:37: internal compiler error: Abort trap: 6 g++-5: internal compiler error: Abort trap: 6 (program cc1plus) Please submit a full bug report, with preprocessed source if appropriate. See <https://github.com/Homebrew/homebrew/issues> for instructions.
dup. *** This bug has been marked as a duplicate of bug 62272 ***
Are you absolutely sure this is a duplicate? The alleged duplicate involes a member function call while this one does not. Also, this code works on 4.9 while the code in the duplicate is verified on 4.9. Unless I'm missing some knowledge of the internals, these two seem like different bugs to me.
Creduce came up with: markus@x4 tmp % cat Uni.ii class A { public: int operator*(); }; template <typename T, typename Predicate> void searchGen(int, int, T, Predicate p4) { p4(0); } template <typename...> struct B; template <typename MetaFunction, typename Type, typename... Types> struct B<MetaFunction, Type, Types...> { static void exec() { MetaFunction::template exec<Type>; } }; template <typename MetaFunction, typename... Types> void forEachType() { B<MetaFunction, Types...>::exec; } namespace { struct C { template <typename T> 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<C, int>; } markus@x4 tmp % /usr/x86_64-pc-linux-gnu/gcc-bin/4.9.3/g++ -std=c++11 -c Uni.ii markus@x4 tmp % g++ -c Uni.ii Uni.ii: In lambda function: Uni.ii:22:33: internal compiler error: in gimplify_var_or_parm_decl, at gimplify.c:1776 searchGen(0, 0, 0, [=](T) { [=] { target; }; }); ^ 0xa653e1 gimplify_var_or_parm_decl ../../gcc/gcc/gimplify.c:1776 0xa6c827 gimplify_expr(tree_node**, gimple_statement_base**, gimple_statement_base**, bool (*)(tree_node*), int) ../../gcc/gcc/gimplify.c:8500 0xa794f6 gimplify_modify_expr ../../gcc/gcc/gimplify.c:4625 0xa6cd94 gimplify_expr(tree_node**, gimple_statement_base**, gimple_statement_base**, bool (*)(tree_node*), int) ../../gcc/gcc/gimplify.c:8069 0xa70ec6 gimplify_stmt(tree_node**, gimple_statement_base**) ../../gcc/gcc/gimplify.c:5525 0xa710ac gimplify_and_add(tree_node*, gimple_statement_base**) ../../gcc/gcc/gimplify.c:398 0xa710ac gimplify_init_ctor_eval ../../gcc/gcc/gimplify.c:3637 0xa78156 gimplify_init_constructor ../../gcc/gcc/gimplify.c:3997 0xa78f97 gimplify_modify_expr_rhs ../../gcc/gcc/gimplify.c:4254 0xa7936d gimplify_modify_expr ../../gcc/gcc/gimplify.c:4584 0xa6cd94 gimplify_expr(tree_node**, gimple_statement_base**, gimple_statement_base**, bool (*)(tree_node*), int) ../../gcc/gcc/gimplify.c:8069 0xa6cebd gimplify_target_expr ../../gcc/gcc/gimplify.c:5456 0xa6cebd gimplify_expr(tree_node**, gimple_statement_base**, gimple_statement_base**, bool (*)(tree_node*), int) ../../gcc/gcc/gimplify.c:8436 0xa70ec6 gimplify_stmt(tree_node**, gimple_statement_base**) ../../gcc/gcc/gimplify.c:5525 0xa6d1b3 gimplify_cleanup_point_expr ../../gcc/gcc/gimplify.c:5301 0xa6d1b3 gimplify_expr(tree_node**, gimple_statement_base**, gimple_statement_base**, bool (*)(tree_node*), int) ../../gcc/gcc/gimplify.c:8432 0xa70ec6 gimplify_stmt(tree_node**, gimple_statement_base**) ../../gcc/gcc/gimplify.c:5525 0xa727bd gimplify_bind_expr ../../gcc/gcc/gimplify.c:1111 0xa6d0ec gimplify_expr(tree_node**, gimple_statement_base**, gimple_statement_base**, bool (*)(tree_node*), int) ../../gcc/gcc/gimplify.c:8266 0xa70ec6 gimplify_stmt(tree_node**, gimple_statement_base**) ../../gcc/gcc/gimplify.c:5525 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <http://gcc.gnu.org/bugs.html> for instructions.
Author: jason Date: Mon Aug 17 18:42:09 2015 New Revision: 226950 URL: https://gcc.gnu.org/viewcvs?rev=226950&root=gcc&view=rev Log: PR c++/67244 * pt.c (tsubst_copy_and_build): Call insert_pending_capture_proxies. Added: trunk/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-nested5.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/pt.c
Author: jason Date: Mon Aug 17 18:42:26 2015 New Revision: 226951 URL: https://gcc.gnu.org/viewcvs?rev=226951&root=gcc&view=rev Log: PR c++/67244 * pt.c (tsubst_copy_and_build): Call insert_pending_capture_proxies. Added: branches/gcc-5-branch/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-nested5.C Modified: branches/gcc-5-branch/gcc/cp/ChangeLog branches/gcc-5-branch/gcc/cp/pt.c
Fixed for 5.3/6.
*** Bug 58907 has been marked as a duplicate of this bug. ***