Bug 1258078 - internal compiler error: in tsubst_copy, at cp/pt.c:12960
Summary: internal compiler error: in tsubst_copy, at cp/pt.c:12960
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 22
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-08-28 22:03 UTC by Sam Varshavchik
Modified: 2016-07-19 17:42 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-19 17:42:35 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
GNU Compiler Collection 67411 0 None None None Never

Description Sam Varshavchik 2015-08-28 22:03:57 UTC
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
         {

Comment 1 Marek Polacek 2015-08-31 08:18:07 UTC
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.

Comment 2 Marek Polacek 2016-03-10 15:36:57 UTC
Fixed upstream and I suppose in rawhide, but gcc-5.3.1-2.fc23.x86_64 surprisingly still ICEs.

Comment 3 Fedora End Of Life 2016-07-19 17:42:35 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.