From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6804 invoked by alias); 23 Sep 2013 22:03:24 -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 6767 invoked by uid 48); 23 Sep 2013 22:03:18 -0000 From: "reichelt at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/58518] New: [4.8/4.9 regression] ICE template specialization Date: Mon, 23 Sep 2013 22:03:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: reichelt at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: 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-09/txt/msg01682.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58518 Bug ID: 58518 Summary: [4.8/4.9 regression] ICE template specialization Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: reichelt at gcc dot gnu.org The following valid code snippet triggers an ICE since GCC 4.8.0: ======================================== template struct A { template struct B {}; template struct B {}; }; A::B<0, 0> b; ======================================== bug.cc:7:17: internal compiler error: in tsubst, at cp/pt.c:11473 A::B<0, 0> b; ^ 0x5a63d5 tsubst(tree_node*, tree_node*, int, tree_node*) ../../gcc/gcc/cp/pt.c:11473 0x5a92a2 convert_template_argument ../../gcc/gcc/cp/pt.c:6424 0x5a3135 coerce_template_parms ../../gcc/gcc/cp/pt.c:6827 0x5bf864 get_class_bindings ../../gcc/gcc/cp/pt.c:18177 0x5c0420 most_specialized_class ../../gcc/gcc/cp/pt.c:18398 0x5d0eb0 instantiate_class_template_1 ../../gcc/gcc/cp/pt.c:8687 0x5d0eb0 instantiate_class_template(tree_node*) ../../gcc/gcc/cp/pt.c:9216 0x65cdcb complete_type(tree_node*) ../../gcc/gcc/cp/typeck.c:132 0x54da66 start_decl_1(tree_node*, bool) ../../gcc/gcc/cp/decl.c:4670 0x577851 start_decl(cp_declarator const*, cp_decl_specifier_seq*, int, tree_node*, tree_node*, tree_node**) ../../gcc/gcc/cp/decl.c:4633 0x649a5a cp_parser_init_declarator ../../gcc/gcc/cp/parser.c:16447 0x64a32f cp_parser_simple_declaration ../../gcc/gcc/cp/parser.c:10986 0x64c190 cp_parser_block_declaration ../../gcc/gcc/cp/parser.c:10867 0x6551ae cp_parser_declaration ../../gcc/gcc/cp/parser.c:10764 0x653f0d cp_parser_declaration_seq_opt ../../gcc/gcc/cp/parser.c:10650 0x6557e6 cp_parser_translation_unit ../../gcc/gcc/cp/parser.c:3939 0x6557e6 c_parse_file() ../../gcc/gcc/cp/parser.c:28893 0x768164 c_common_parse_file() ../../gcc/gcc/c-family/c-opts.c:1046 Please submit a full bug report, [etc.] A little longer testcase triggers an ICE in a different function: ======================================== template struct A { typedef typename T::X U; template struct B {}; template struct B {}; }; struct C { typedef int X; }; A::B<0, 0> b; ======================================== bug.cc:14:15: internal compiler error: in dependent_type_p, at cp/pt.c:19969 A::B<0, 0> b; ^ 0x588d28 dependent_type_p(tree_node*) ../../gcc/gcc/cp/pt.c:19969 0x589504 dependent_scope_p(tree_node*) ../../gcc/gcc/cp/pt.c:20000 0x54aed7 make_typename_type(tree_node*, tree_node*, tag_types, int) ../../gcc/gcc/cp/decl.c:3331 0x5a5781 tsubst(tree_node*, tree_node*, int, tree_node*) ../../gcc/gcc/cp/pt.c:11914 0x5a92a2 convert_template_argument ../../gcc/gcc/cp/pt.c:6424 0x5a3135 coerce_template_parms ../../gcc/gcc/cp/pt.c:6827 0x5bf864 get_class_bindings ../../gcc/gcc/cp/pt.c:18177 0x5c0420 most_specialized_class ../../gcc/gcc/cp/pt.c:18398 0x5d0eb0 instantiate_class_template_1 ../../gcc/gcc/cp/pt.c:8687 0x5d0eb0 instantiate_class_template(tree_node*) ../../gcc/gcc/cp/pt.c:9216 0x65cdcb complete_type(tree_node*) ../../gcc/gcc/cp/typeck.c:132 0x54da66 start_decl_1(tree_node*, bool) ../../gcc/gcc/cp/decl.c:4670 0x577851 start_decl(cp_declarator const*, cp_decl_specifier_seq*, int, tree_node*, tree_node*, tree_node**) ../../gcc/gcc/cp/decl.c:4633 0x649a5a cp_parser_init_declarator ../../gcc/gcc/cp/parser.c:16447 0x64a32f cp_parser_simple_declaration ../../gcc/gcc/cp/parser.c:10986 0x64c190 cp_parser_block_declaration ../../gcc/gcc/cp/parser.c:10867 0x6551ae cp_parser_declaration ../../gcc/gcc/cp/parser.c:10764 0x653f0d cp_parser_declaration_seq_opt ../../gcc/gcc/cp/parser.c:10650 0x6557e6 cp_parser_translation_unit ../../gcc/gcc/cp/parser.c:3939 0x6557e6 c_parse_file() ../../gcc/gcc/cp/parser.c:28893 Please submit a full bug report, [etc.]