------- Comment #19 from manu at gcc dot gnu dot org 2010-04-17 07:59 ------- (In reply to comment #18) > 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? No, to 2 elements, the original instantiation, and the recursive instantiation. /home/manuel/src/pr9335.C:2:36: error: template instantiation depth exceeds maximum of 1024 (use -ftemplate-depth= to increase the maximum) instantiating �struct X<-0x00000000000000018>� /home/manuel/src/pr9335.C:2:36: recursively instantiated from �const int X<1000>::value� /home/manuel/src/pr9335.C:4:17: instantiated from here > I think the previous change to skip all but 10 is good enough. Well, the patch is mostly done, it reduces the output from 11 to 1 lines and it neatly points out where is the recursive instantiation. So I hope you may reconsider, unless you think the 101 lines are useful to the user somehow. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9335