Hi, Compile this program with -O1 or better. You'll get a compiler internal error. #include <set> class BugGCC { public: // if the constructor is defined outside of the class declaration: // g++: Internal error: Segmentation fault (cc1plus) BugGCC( const set<int>& aset = set<int>() ); // if the constructor is defined inline: // no error // BugGCC( const set<int>& aset = set<int>() ) : myset( aset ) { } private: set<int> myset; }; // if the constructor is defined outside of the class declaration: // g++: Internal error: Segmentation fault (cc1plus) BugGCC::BugGCC( const set<int>& aset ) : myset( aset ) { } int main() { BugGCC abug; }
Created attachment 5483 [details] C++ source file to reproduce the bug. Compile with -O1 or better.
Fixed in gcc-c++-2.96-61 and above (in rawhide is ATM I think -63).