Bug 982324 - internal compiler error: in tsubst_copy
Summary: internal compiler error: in tsubst_copy
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Developer Toolset
Classification: Red Hat
Component: gcc
Version: DTS 1.1 RHEL 6
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: alpha
: 2.4
Assignee: Jakub Jelinek
QA Contact: Dagmar Prokopová
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-07-08 16:49 UTC by Giovanni Bianchi
Modified: 2014-07-01 22:54 UTC (History)
8 users (show)

Fixed In Version: devtoolset-2-gcc-4.8.2-1.el6
Doc Type: Bug Fix
Doc Text:
Previously, GCC could crash when compiling a C++11 program that is using a lambda function in a class. This has been fixed in a way that GCC now accepts default argument-scope lambdas in a class and correctly compiles such a program.
Clone Of:
Environment:
Last Closed: 2014-03-11 06:36:49 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
preprocessed source (187.43 KB, text/x-csrc)
2013-07-08 16:49 UTC, Giovanni Bianchi
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:0272 0 normal SHIPPED_LIVE devtoolset-2-gcc bug fix and enhancement update 2014-03-11 10:33:11 UTC

Description Giovanni Bianchi 2013-07-08 16:49:23 UTC
Created attachment 770574 [details]
preprocessed source

Description of problem:
Internal compiler error while trying to compile my C++11 code.

Error message:
"
internal compiler error: in tsubst_copy
test.h: In constructor ‘A::A(const T&) [with T = std::function<int()>]’:
test.h:14:5: internal compiler error: in tsubst_copy, at cp/pt.c:12141
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
Preprocessed source stored into /tmp/local/ccfRXm2S.out file, please attach this to your bugreport.
"

Version-Release number of selected component (if applicable):
gcc 4.7.2-5

How reproducible:
The following minimal code can be used to reproduce the issue:

#include <functional>

class A {
  typedef std::function<int()> Func;
  Func f_;
public:
  template<class T = Func> A(const T& f = []() { return 0; }) : f_(f) {}
};

int main(int argc, char* argv[]) {
  A a;
}

Compiled with: g++ -std=c++11 test.h

Additional info:
It might be tied to lambda functions being used as default arguments in a class's constructor

Comment 6 Marek Polacek 2013-10-17 12:00:22 UTC
Fixed in devtoolset-2-gcc-4.8.2-1.el6.

Comment 8 Dagmar Prokopová 2013-11-11 14:11:00 UTC
Verified for devtoolset-2-gcc-4.8.2-1.

Comment 10 errata-xmlrpc 2014-03-11 06:36:49 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2014-0272.html


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