http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51488
Paolo Carlini <paolo.carlini at oracle dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |manu at gcc dot gnu.org --- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> --- 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