The following code compiles cleanly without the -ggdb flag, i.e. using: g++ -save-temps testit.cpp -o testit
but adding the -ggdb flag: g++ -ggdb -save-temps testit.cpp -o testit results in the following error output: testit.cpp:10:1: internal compiler error: in gen_type_die_with_usage, at dwarf2out.c:15108 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. Exact code compiled from testit.ii: # 1 "testit.cpp" # 1 "<built-in>" # 1 "<command-line>" # 1 "testit.cpp" template <unsigned int n> class foo { public: typedef unsigned char type; }; template<> class foo<1> { typedef enum {} type; }; int main() { } -- Summary: Using -ggdb flag cause internal Product: gcc Version: 4.5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: phorgan1 at gmail dot com GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40705