gcc-5.1.1-4.fc22.x86_64 g++ -g -c -o /tmp/t -std=c++1y -O2 /tmp/t.C t.C: #include <tuple> template<typename functor_type> void invoke_lambda(functor_type &&functor) { functor(); } template<typename functor_type, typename arg_type> void invoke_lambda(arg_type &&arg, functor_type &&functor) { functor(std::forward<arg_type>(arg)); } class conn; class ts { public: int timestamp; }; void bar(conn *c, int timestamp) { } void foo(conn *c, ts *t) { invoke_lambda([tuple_conn=std::make_tuple(c), timestamp=t->timestamp] { invoke_lambda(tuple_conn, [&] (const auto &tuple_conn) { invoke_lambda([=] { bar(std::get<0>(tuple_conn), timestamp); }); }); }); } Results: /tmp/t.C: In instantiation of ‘foo(conn*, ts*)::<lambda()>::<lambda(const auto:1&)>::<lambda()> [with auto:1 = std::tuple<conn*>]’: /tmp/t.C:37:28: required from ‘struct foo(conn*, ts*)::<lambda()>::<lambda(const auto:1&)> [with auto:1 = std::tuple<conn*>]::<lambda()>’ /tmp/t.C:35:24: required from ‘foo(conn*, ts*)::<lambda()>::<lambda(const auto:1&)> [with auto:1 = std::tuple<conn*>]’ /tmp/t.C:12:9: required from ‘void invoke_lambda(arg_type&&, functor_type&&) [with functor_type = foo(conn*, ts*)::<lambda()>::<lambda(const auto:1&)>; arg_type = const std::tuple<conn*>&]’ /tmp/t.C:41:11: required from here /tmp/t.C:30:9: internal compiler error: in tsubst_copy, at cp/pt.c:12960 {
Reproduced even with vanilla gcc mainline. I couldn't find an upstream PR for this, so I'm going to file one. Seems it started with r211084.
Fixed upstream and I suppose in rawhide, but gcc-5.3.1-2.fc23.x86_64 surprisingly still ICEs.
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.