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++/82468] New: ICE with deduction guide template


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

            Bug ID: 82468
           Summary: ICE with deduction guide template
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: barry.revzin at gmail dot com
  Target Milestone: ---

If we try to make the template-name of the deduction guide a type-parameter,
courtesy of W.F. on SO (https://stackoverflow.com/q/46624005/2069064):

template <class T>
struct Foo {
   Foo(T) { }
};

template <template <class> class TT>
TT(double) -> TT<int>;

int main() {
    Foo foo(2.0);
}

yields:

prog.cc:7:15: internal compiler error: Segmentation fault
 TT(double) -> TT<int>;
               ^~~~~~~
0xbcb8bf crash_signal
        ../../source/gcc/toplev.c:326
0x70b892 check_special_function_return_type
        ../../source/gcc/cp/decl.c:9742
0x70b892 grokdeclarator(cp_declarator const*, cp_decl_specifier_seq*,
decl_context, int, tree_node**)
        ../../source/gcc/cp/decl.c:10319
0x70f126 start_decl(cp_declarator const*, cp_decl_specifier_seq*, int,
tree_node*, tree_node*, tree_node**)
        ../../source/gcc/cp/decl.c:4909
0x780e6e cp_parser_init_declarator
        ../../source/gcc/cp/parser.c:19489
0x785c3a cp_parser_single_declaration
        ../../source/gcc/cp/parser.c:27073
0x785d6c cp_parser_template_declaration_after_parameters
        ../../source/gcc/cp/parser.c:26676
0x7863ff cp_parser_explicit_template_declaration
        ../../source/gcc/cp/parser.c:26912
0x7863ff cp_parser_template_declaration_after_export
        ../../source/gcc/cp/parser.c:26931
0x78a151 cp_parser_declaration
        ../../source/gcc/cp/parser.c:12676
0x78a41b cp_parser_declaration_seq_opt
        ../../source/gcc/cp/parser.c:12603
0x78a6de cp_parser_translation_unit
        ../../source/gcc/cp/parser.c:4391
0x78a6de c_parse_file()
        ../../source/gcc/cp/parser.c:38915
0x83adc6 c_common_parse_file()
        ../../source/gcc/c-family/c-opts.c:1113

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