The compiler ICEs on the following invalid code snippet since GCC 3.0: =================================================== template<template<int> class A> class A<0> {}; =================================================== bug.cc:1: internal compiler error: tree check: expected record_type or union_type or qual_union_type, have bound_template_template_parm in xref_basetypes, at cp/decl.c:9788 Please submit a full bug report, [etc.] In addition the compiler accepts the following similar invalid code snippet: =================================================== template<template<int> class A> class A<0>; =================================================== Posting a patch soon.
Subject: Bug number PR c++/28860 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2006-08/msg01014.html
Subject: Bug 28860 Author: reichelt Date: Mon Aug 28 22:34:55 2006 New Revision: 116541 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=116541 Log: PR c++/28860 * cp-tree.h (maybe_process_partial_specialization): Return tree instead of void. * parser.c (cp_parser_class_head): Use return value of maybe_process_partial_specialization. * pt.c (maybe_process_partial_specialization): Return error_mark_node for broken specializations, TYPE otherwise. Check for template template parameters. * g++.dg/template/ttp22.C: New test. Added: trunk/gcc/testsuite/g++.dg/template/ttp22.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/cp-tree.h trunk/gcc/cp/parser.c trunk/gcc/cp/pt.c trunk/gcc/testsuite/ChangeLog
Subject: Bug 28860 Author: reichelt Date: Mon Aug 28 22:51:17 2006 New Revision: 116543 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=116543 Log: PR c++/28860 * cp-tree.h (maybe_process_partial_specialization): Return tree instead of void. * parser.c (cp_parser_class_head): Use return value of maybe_process_partial_specialization. * pt.c (maybe_process_partial_specialization): Return error_mark_node for broken specializations, TYPE otherwise. Check for template template parameters. * g++.dg/template/ttp22.C: New test. Added: branches/gcc-4_1-branch/gcc/testsuite/g++.dg/template/ttp22.C Modified: branches/gcc-4_1-branch/gcc/cp/ChangeLog branches/gcc-4_1-branch/gcc/cp/cp-tree.h branches/gcc-4_1-branch/gcc/cp/parser.c branches/gcc-4_1-branch/gcc/cp/pt.c branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
Subject: Bug 28860 Author: reichelt Date: Mon Aug 28 23:12:32 2006 New Revision: 116544 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=116544 Log: PR c++/28860 * cp-tree.h (maybe_process_partial_specialization): Return tree instead of void. * parser.c (cp_parser_class_head): Use return value of maybe_process_partial_specialization. * pt.c (maybe_process_partial_specialization): Return error_mark_node for broken specializations, TYPE otherwise. Check for template template parameters. * g++.dg/template/ttp22.C: New test. Added: branches/gcc-4_0-branch/gcc/testsuite/g++.dg/template/ttp22.C Modified: branches/gcc-4_0-branch/gcc/cp/ChangeLog branches/gcc-4_0-branch/gcc/cp/cp-tree.h branches/gcc-4_0-branch/gcc/cp/parser.c branches/gcc-4_0-branch/gcc/cp/pt.c branches/gcc-4_0-branch/gcc/testsuite/ChangeLog
Fixed on mainline, 4.1 branch, and 4.0 branch.