Compiler crashed with these lines g++ main.cpp expenditure_category.h expenditure_category.cpp -O4 expenditure_category.h: In member function ‘bool expenditure::category_compare::operator()(const expenditure::category&, const expenditure::category&) const’: expenditure_category.h:33: error: ‘parent1’ was not declared in this scope expenditure_category.h: In member function ‘bool expenditure::category_compare::operator()(const expenditure::category&, const expenditure::category&) const’: expenditure_category.h:33: error: ‘parent1’ was not declared in this scope expenditure_category.cpp:28: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. For Debian GNU/Linux specific bug reporting instructions, see <URL:file:///usr/share/doc/gcc-4.1/README.Bugs>. Preprocessed source stored into /tmp/ccZFb4sl.out file, please attach this to your bugreport.
Created attachment 16232 [details] the temporary file /tmp/ccZFb4sl.out
Here is the output without the optimization options g++ main.cpp expenditure_category.h expenditure_category.cpp expenditure_category.h: In member function ‘bool expenditure::category_compare::operator()(const expenditure::category&, const expenditure::category&) const’: expenditure_category.h:33: error: ‘parent1’ was not declared in this scope expenditure_category.h: In member function ‘bool expenditure::category_compare::operator()(const expenditure::category&, const expenditure::category&) const’: expenditure_category.h:33: error: ‘parent1’ was not declared in this scope
Target? x86_64-linux? I can't reproduce the problem on FSF 4.1.3, neither with 4.2.5, 4.3.2 or mainline. I suspect it's a Debian modification at fault, not to be reported here... PS: -OX, with X >= 3 are all the same.
Figured out from the attachment...
can't reproduce this either with the Debian or Ubuntu gcc builds
No feedback in 3 months and it works for me so closing as such.