http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58430
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- You are instantitating 2^900 templates which will take quite some time. Lower -ftemplate-depth to something reasonable (the default is 900) to get an error: > g++-4.7 -S t.C -ftemplate-depth=3 t.C:4:3: error: template instantiation depth exceeds maximum of 3 (use -ftemplate-depth= to increase the maximum) substituting 'template<unsigned int I1, unsigned int I2> void test() [with unsigned int I1 = 3221225473u; unsigned int I2 = 0u]' t.C:4:3: recursively required from 'void test() [with unsigned int I1 = 1u; unsigned int I2 = 0u]' t.C:4:3: required from 'void test() [with unsigned int I1 = 0u; unsigned int I2 = 0u]' t.C:10:14: required from here Or limit instantiation by providing a terminating specialization.