Bug 982324 - internal compiler error: in tsubst_copy
internal compiler error: in tsubst_copy
Status: CLOSED ERRATA
Product: Red Hat Developer Toolset
Classification: Red Hat
Component: gcc (Show other bugs)
DTS 1.1 RHEL 6
x86_64 Linux
unspecified Severity low
: alpha
: 2.4
Assigned To: Jakub Jelinek
Dagmar Prokopová
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-08 12:49 EDT by Giovanni Bianchi
Modified: 2014-07-01 18:54 EDT (History)
8 users (show)

See Also:
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.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-03-11 02:36:49 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:0272 normal SHIPPED_LIVE devtoolset-2-gcc bug fix and enhancement update 2014-03-11 06:33:11 EDT

  None (edit)
Description Giovanni Bianchi 2013-07-08 12:49:23 EDT
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 08:00:22 EDT
Fixed in devtoolset-2-gcc-4.8.2-1.el6.
Comment 8 Dagmar Prokopová 2013-11-11 09:11:00 EST
Verified for devtoolset-2-gcc-4.8.2-1.
Comment 10 errata-xmlrpc 2014-03-11 02:36:49 EDT
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.