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
Fixed in devtoolset-2-gcc-4.8.2-1.el6.
Verified for devtoolset-2-gcc-4.8.2-1.
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