From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29287 invoked by alias); 17 Apr 2010 03:53:40 -0000 Received: (qmail 29242 invoked by uid 48); 17 Apr 2010 03:53:28 -0000 Date: Sat, 17 Apr 2010 03:53:00 -0000 Message-ID: <20100417035328.29241.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/9335] repeated diagnostic when maximum template depth is exceeded In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "jason at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-04/txt/msg01623.txt.bz2 ------- 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