http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53989
Bug #: 53989 Summary: Internal compiler error in strip_typedefs, at cp/tree.c:1187 Classification: Unclassified Product: gcc Version: 4.7.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: g...@limax.org Running 'g++ -std=c++0x -c test.cpp' with the following source saved as test.cpp: --------------- struct Foo { int value; static Foo const foos[2]; }; void bar() { for (Foo f : Foo::foos) { (void) f; } } -------------- produces this result: --------------- test.cpp: In function ‘void bar()’: test.cpp:8:21: internal compiler error: in strip_typedefs, at cp/tree.c:1187 --------------- If I get rid of the 'value' member of Foo, or if I provide a definition of Foo::foos before it is used by Bar, or if I change Foo::foos to be type 'Foo' instead of type 'Foo const', or if I move Foo::foos outside of class Foo, I don't see the error. GCC was built using the following configuration: $ gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/home/tools/sw/gcc/471/rhel5-x86_64/libexec/gcc/x86_64-unknown-linux-gnu/4.7.1/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ./configure --prefix=/home/tools/sw/gcc/471/rhel5-x86_64 --with-gmp=/home/tools/sw/gcc/471/rhel5-x86_64 --with-ppl=/home/tools/sw/gcc/471/rhel5-x86_64 --with-cloog=/home/tools/sw/gcc/471/rhel5-x86_64 --enable-cloog-backend=isl --with-system-zlib --enable-__cxa_atexit --enable-shared --enable-threads=posix --enable-languages=c,c++,fortran Thread model: posix gcc version 4.7.1 (GCC)