------- Comment #18 from jason at gcc dot gnu dot org 2010-04-17 03:53 ------- The output with my patch is
wa.C:2:38: error: template instantiation depth exceeds maximum of 1024 (use -ftemplate-depth= to increase the maximum) instantiating struct X<-0x000000018> wa.C:2:38: instantiated from const int X<-0x000000017>::value wa.C:2:38: instantiated from const int X<-0x000000016>::value wa.C:2:38: instantiated from const int X<-0x000000015>::value wa.C:2:38: instantiated from const int X<-0x000000014>::value wa.C:2:38: instantiated from const int X<-0x000000013>::value wa.C:2:38: [ skipping 1014 instantiation contexts ] wa.C:2:38: instantiated from const int X<996>::value wa.C:2:38: instantiated from const int X<997>::value wa.C:2:38: instantiated from const int X<998>::value wa.C:2:38: instantiated from const int X<999>::value wa.C:2:38: instantiated from const int X<1000>::value wa.C:4:17: instantiated from here wa.C:2:38: error: incomplete type X<-0x000000018> used in nested name specifier it avoids the error cascade by avoiding all the non-constant initializer errors. I guess your patch just cuts down the "instantiated from" list to one element? I think the previous change to skip all but 10 is good enough. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9335