public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/58674] New: [4.8/4.9 Regression] [c++11] ICE with template using declaration
@ 2013-10-09 21:15 reichelt at gcc dot gnu.org
  2013-10-10 12:03 ` [Bug c++/58674] " rguenth at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: reichelt at gcc dot gnu.org @ 2013-10-09 21:15 UTC (permalink / raw)
  To: gcc-bugs

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.]


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-01-29 17:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-09 21:15 [Bug c++/58674] New: [4.8/4.9 Regression] [c++11] ICE with template using declaration reichelt at gcc dot gnu.org
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

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).