From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3440 invoked by alias); 11 Aug 2013 10:03:49 -0000 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 Received: (qmail 3401 invoked by uid 48); 11 Aug 2013 10:03:46 -0000 From: "paolo.carlini at oracle dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/51488] ICE on infinite template recursion Date: Sun, 11 Aug 2013 10:03:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: unknown X-Bugzilla-Keywords: ice-on-invalid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: paolo.carlini at oracle dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-08/txt/msg00590.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51488 Paolo Carlini changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |manu at gcc dot gnu.org --- Comment #2 from Paolo Carlini --- Manuel, looks like these 3 testcases are instances of the very same issue: our template instantiation depth control mechanism doesn't handle this case. I'm attaching below a piece of a stack trace, to show you the infinite recursion. I seem to remember you did work in this area: any tips to handle this case too? //////////////// #82 0x000000000060338e in instantiate_class_template (type=0x7ffff687eb28) at /scratch/Gcc/svn-dirs/trunk/gcc/cp/pt.c:9176 #83 0x00000000006e1e94 in complete_type (type=0x7ffff687eb28) at /scratch/Gcc/svn-dirs/trunk/gcc/cp/typeck.c:131 #84 0x000000000061142b in tsubst (t=0x7ffff687e930, args=0x7ffff613d880, complain=0, in_decl=0x0) at /scratch/Gcc/svn-dirs/trunk/gcc/cp/pt.c:11815 #85 0x00000000006033fc in tsubst_template_arg (t=0x7ffff687e930, args=0x7ffff613d880, complain=0, in_decl=0x0) at /scratch/Gcc/svn-dirs/trunk/gcc/cp/pt.c:9189 #86 0x000000000060549d in tsubst_template_args (t=0x7ffff613fe60, args=0x7ffff613d880, complain=0, in_decl=0x0) at /scratch/Gcc/svn-dirs/trunk/gcc/cp/pt.c:9730 #87 0x0000000000610886 in tsubst (t=0x7ffff613fe60, args=0x7ffff613d880, complain=0, in_decl=0x0) at /scratch/Gcc/svn-dirs/trunk/gcc/cp/pt.c:11580 #88 0x000000000062f333 in get_class_bindings (main_tmpl=0x7ffff6878ac8, tparms=0x7ffff688a800, spec_args=0x7ffff613fe60, args=0x7ffff688d528) at /scratch/Gcc/svn-dirs/trunk/gcc/cp/pt.c:18055 #89 0x0000000000630399 in most_specialized_class (type=0x7ffff687eb28, tmpl=0x7ffff6878ac8, complain=3) at /scratch/Gcc/svn-dirs/trunk/gcc/cp/pt.c:18279 #90 0x0000000000600ad1 in instantiate_class_template_1 (type=0x7ffff687eb28) at /scratch/Gcc/svn-dirs/trunk/gcc/cp/pt.c:8665 #91 0x000000000060338e in instantiate_class_template (type=0x7ffff687eb28) at /scratch/Gcc/svn-dirs/trunk/gcc/cp/pt.c:9176