http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54928
Bug #: 54928 Summary: Infinite output with after ICE with macro Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: ca...@cs.stanford.edu Compiling this without options produces infinite output. #define M(x) x template<class T> class A {void F(){M(sizeof(double));}}; template class A<int>; Beginning of output: prog.cpp: In instantiation of ‘void A<T>::F() [with T = int]’: prog.cpp:3:16: required from here prog.cpp:2:45: internal compiler error: in tsubst_copy, at cp/pt.c:12349 template<class T> class A {void F(){M(sizeof(double));}}; ^ prog.cpp:1:14: note: in definition of macro 'M' #define M(x) x ^ prog.cpp:2:45: internal compiler error: in internal_error, at diagnostic.c:1069 template<class T> class A {void F(){M(sizeof(double));}}; ^ prog.cpp:1:14: note: in definition of macro 'M' #define M(x) x ^ <the last bit repeats over and over.> Output of g++ -v: Using built-in specs. COLLECT_GCC=/new-gcc/i-4.8/bin/g++ COLLECT_LTO_WRAPPER=/new-gcc/i-4.8/libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ../s-4.8/configure --prefix=/new-gcc/i-4.8 Thread model: posix gcc version 4.8.0 20121014 (experimental) (GCC) I filed the ICE leading up to the infinite loop as a separate bug.