From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25982 invoked by alias); 9 Oct 2013 21:15:20 -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 25966 invoked by uid 48); 9 Oct 2013 21:15:18 -0000 From: "reichelt at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/58674] New: [4.8/4.9 Regression] [c++11] ICE with template using declaration Date: Wed, 09 Oct 2013 21:15: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-10/txt/msg00516.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58674 Bug ID: 58674 Summary: [4.8/4.9 Regression] [c++11] ICE with template using declaration 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 invalid code snippet (compiled with "-std=c++11") triggers an ICE since GCC 4.8.0: ==================================== template struct A {}; template using B = A; template struct C { B b; }; struct X { static const int i; }; C c; ==================================== bug.cc: In substitution of 'template using B = A [with int N = X::i]': bug.cc:7:11: required from 'struct C' bug.cc:15:6: required from here bug.cc:7:11: error: the value of 'X::i' is not usable in a constant expression B b; ^ bug.cc:12:20: note: 'X::i' was not initialized with a constant expression static const int i; ^ bug.cc:7:11: note: in template argument for type 'int' B b; ^ bug.cc:7:11: internal compiler error: tree check: expected tree_vec, have error_mark in get_innermost_template_args, at cp/pt.c:569 0xcec8da tree_check_failed(tree_node const*, char const*, int, char const*, ...) ../../gcc/gcc/tree.c:9176 0x587845 tree_check ../../gcc/gcc/tree.h:2609 0x587845 get_innermost_template_args(tree_node*, int) ../../gcc/gcc/cp/pt.c:569 0x5d0585 instantiate_template_1 ../../gcc/gcc/cp/pt.c:15042 0x5d0585 instantiate_template(tree_node*, tree_node*, int) ../../gcc/gcc/cp/pt.c:15117 0x5ac7bb instantiate_alias_template ../../gcc/gcc/cp/pt.c:15147 0x5ac7bb tsubst(tree_node*, tree_node*, int, tree_node*) ../../gcc/gcc/cp/pt.c:11312 0x5bca41 tsubst_decl ../../gcc/gcc/cp/pt.c:10657 0x5ac634 tsubst(tree_node*, tree_node*, int, tree_node*) ../../gcc/gcc/cp/pt.c:11285 0x5d8fc1 instantiate_class_template_1 ../../gcc/gcc/cp/pt.c:8952 0x5d8fc1 instantiate_class_template(tree_node*) ../../gcc/gcc/cp/pt.c:9216 0x66435b complete_type(tree_node*) ../../gcc/gcc/cp/typeck.c:132 0x554fa9 start_decl_1(tree_node*, bool) ../../gcc/gcc/cp/decl.c:4670 0x57edbd start_decl(cp_declarator const*, cp_decl_specifier_seq*, int, tree_node*, tree_node*, tree_node**) ../../gcc/gcc/cp/decl.c:4633 0x650fd8 cp_parser_init_declarator ../../gcc/gcc/cp/parser.c:16453 0x65187f cp_parser_simple_declaration ../../gcc/gcc/cp/parser.c:10995 0x653700 cp_parser_block_declaration ../../gcc/gcc/cp/parser.c:10876 0x65c73e cp_parser_declaration ../../gcc/gcc/cp/parser.c:10773 0x65b4aa cp_parser_declaration_seq_opt ../../gcc/gcc/cp/parser.c:10659 0x65cd76 cp_parser_translation_unit ../../gcc/gcc/cp/parser.c:3939 Please submit a full bug report, [etc.]