This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/66607] New: ICE instantiating a template on a function reference


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66607

            Bug ID: 66607
           Summary: ICE instantiating a template on a function reference
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: msebor at gcc dot gnu.org
  Target Milestone: ---

Today's trunk (revision 224699) fails with an ICE on the C++ program below:

$ cat /build/tmp/u.cpp && /build/gcc-trunk/gcc/xg++ -B/build/gcc-trunk/gcc -c
-o/dev/null /build/tmp/u.cpp
typedef int F ();

F foo;

template <F&> struct A { };
A<foo> a;
/build/tmp/u.cpp: In instantiation of âstruct A<foo>â:
/build/tmp/u.cpp:6:8:   required from here
/build/tmp/u.cpp:5:24: internal compiler error: in retrieve_specialization, at
cp/pt.c:1059
 template <F&> struct A { };
                        ^
0x7919ca retrieve_specialization
        /home/msebor/scm/fsf/gcc-git/gcc/cp/pt.c:1059
0x7c8652 tsubst_decl
        /home/msebor/scm/fsf/gcc-git/gcc/cp/pt.c:11366
0x7ca4ee tsubst(tree_node*, tree_node*, int, tree_node*)
        /home/msebor/scm/fsf/gcc-git/gcc/cp/pt.c:11890
0x7be5e8 instantiate_class_template_1
        /home/msebor/scm/fsf/gcc-git/gcc/cp/pt.c:9458
0x7bf3f2 instantiate_class_template(tree_node*)
        /home/msebor/scm/fsf/gcc-git/gcc/cp/pt.c:9730
0x8b6e76 complete_type(tree_node*)
        /home/msebor/scm/fsf/gcc-git/gcc/cp/typeck.c:139
0x757ac0 start_decl_1(tree_node*, bool)
        /home/msebor/scm/fsf/gcc-git/gcc/cp/decl.c:4903
0x7578c9 start_decl(cp_declarator const*, cp_decl_specifier_seq*, int,
tree_node*, tree_node*, tree_node**)
        /home/msebor/scm/fsf/gcc-git/gcc/cp/decl.c:4866
0x883e29 cp_parser_init_declarator
        /home/msebor/scm/fsf/gcc-git/gcc/cp/parser.c:17187
0x87af06 cp_parser_simple_declaration
        /home/msebor/scm/fsf/gcc-git/gcc/cp/parser.c:11608
0x87acd8 cp_parser_block_declaration
        /home/msebor/scm/fsf/gcc-git/gcc/cp/parser.c:11482
0x87aa5b cp_parser_declaration
        /home/msebor/scm/fsf/gcc-git/gcc/cp/parser.c:11379
0x87a610 cp_parser_declaration_seq_opt
        /home/msebor/scm/fsf/gcc-git/gcc/cp/parser.c:11265
0x86daf3 cp_parser_translation_unit
        /home/msebor/scm/fsf/gcc-git/gcc/cp/parser.c:4097
0x8a9ce7 c_parse_file()
        /home/msebor/scm/fsf/gcc-git/gcc/cp/parser.c:33241
0xa25369 c_common_parse_file()
        /home/msebor/scm/fsf/gcc-git/gcc/c-family/c-opts.c:1060
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]