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

            Bug ID: 82030
           Summary: [8 Regression] ICE: Segmentation fault
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: trippels at gcc dot gnu.org
  Target Milestone: ---

% cat functional.ii
template <typename T, typename U = T> struct A { using type = U; };
template <typename F, typename... G> struct B : B<F>::type, B<G...>::type {
  using type = B;
  using B<F>::type::operator();
};
template <typename F> struct B<F> { using type = F; };
struct {
  template <typename... F,
            typename Overload = typename B<typename A<F>::type...>::type>
  Overload operator()(F...){};
} a;
int main() {
  auto f = a([](int) {}, [](float) {});
  f({});
}

 % g++ functional.ii
functional.ii: In function ‘int main()’:
functional.ii:14:7: internal compiler error: Segmentation fault
   f({});
       ^
0x10bc6de3 crash_signal
        ../../gcc/gcc/toplev.c:341
0x102182fc compare_ics
        ../../gcc/gcc/cp/call.c:9564
0x10220a6b joust
        ../../gcc/gcc/cp/call.c:9993
0x10222993 joust
        ../../gcc/gcc/cp/call.c:10431
0x10222993 tourney
        ../../gcc/gcc/cp/call.c:10395
0x1023040b build_op_call_1
        ../../gcc/gcc/cp/call.c:4543
0x1023040b build_op_call(tree_node*, vec<tree_node*, va_gc, vl_embed>**, int)
        ../../gcc/gcc/cp/call.c:4585
0x1049fc6b finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**,
bool, bool, int)
        ../../gcc/gcc/cp/semantics.c:2502
0x103cdbd7 cp_parser_postfix_expression
        ../../gcc/gcc/cp/parser.c:7124
0x103ee65f cp_parser_unary_expression
        ../../gcc/gcc/cp/parser.c:8248
0x103b49e3 cp_parser_cast_expression
        ../../gcc/gcc/cp/parser.c:9016
0x103b5307 cp_parser_binary_expression
        ../../gcc/gcc/cp/parser.c:9117
0x103b5da7 cp_parser_assignment_expression
        ../../gcc/gcc/cp/parser.c:9404
0x103b9a77 cp_parser_expression
        ../../gcc/gcc/cp/parser.c:9573
0x103ba3f7 cp_parser_expression_statement
        ../../gcc/gcc/cp/parser.c:11071
0x103c843f cp_parser_statement
        ../../gcc/gcc/cp/parser.c:10887
0x103c97a3 cp_parser_statement_seq_opt
        ../../gcc/gcc/cp/parser.c:11214
0x103c9927 cp_parser_compound_statement
        ../../gcc/gcc/cp/parser.c:11168
0x103e776f cp_parser_function_body
        ../../gcc/gcc/cp/parser.c:21624
0x103e776f cp_parser_ctor_initializer_opt_and_function_body
        ../../gcc/gcc/cp/parser.c:21660

Reply via email to