public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "reichelt at gcc dot gnu.org" <gcc-bugzilla@gcc.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 [thread overview] Message-ID: <bug-58674-4@http.gcc.gnu.org/bugzilla/> (raw) 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<int> struct A {}; template<int N> using B = A<N>; template<typename T> struct C { B<T::i> b; }; struct X { static const int i; }; C<X> c; ==================================== bug.cc: In substitution of 'template<int N> using B = A<N> [with int N = X::i]': bug.cc:7:11: required from 'struct C<X>' 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<T::i> 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<T::i> 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.]
next reply other threads:[~2013-10-09 21:15 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2013-10-09 21:15 reichelt at gcc dot gnu.org [this message] 2013-10-10 12:03 ` [Bug c++/58674] " rguenth at gcc dot gnu.org 2013-10-16 9:48 ` jakub at gcc dot gnu.org 2014-01-29 13:49 ` paolo.carlini at oracle dot com 2014-01-29 17:55 ` paolo at gcc dot gnu.org 2014-01-29 17:56 ` [Bug c++/58674] [4.8 " paolo.carlini at oracle dot com
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-58674-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).