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

            Bug ID: 66786
           Summary: [6 Regression] ICE: Segmentation fault
           Product: gcc
           Version: 6.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 strong_datatypes.ii
template <typename> auto list = [](auto... xs) { [=](auto f) { f(xs...); }; };
int main() { list<int>(0); }

 % c++ -c strong_datatypes.ii
strong_datatypes.ii: In instantiation of ‘auto list<int>’:
strong_datatypes.ii:2:14:   required from here
strong_datatypes.ii:1:26: error: use of ‘list<int>’ before deduction of ‘auto’
 template <typename> auto list = [](auto... xs) { [=](auto f) { f(xs...); }; };
                          ^
strong_datatypes.ii: In instantiation of ‘<lambda(auto:1 ...)> [with auto:1 =
{int}; <template-parameter-1-1> = int]’:
strong_datatypes.ii:2:25:   required from here
strong_datatypes.ii:1:50: internal compiler error: Segmentation fault
 template <typename> auto list = [](auto... xs) { [=](auto f) { f(xs...); }; };
                                                  ^
0x10b5cbd3 crash_signal
        ../../gcc/gcc/toplev.c:360
0x10408140 contains_struct_check
        ../../gcc/gcc/tree.h:2971
0x10408140 build_lambda_object(tree_node*)
        ../../gcc/gcc/cp/lambda.c:92
0x102186c3 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ../../gcc/gcc/cp/pt.c:15821
0x101f752b tsubst_expr
        ../../gcc/gcc/cp/pt.c:14519
0x101f8053 tsubst_expr
        ../../gcc/gcc/cp/pt.c:13930
0x101f7047 tsubst_expr
        ../../gcc/gcc/cp/pt.c:13916
0x101f7ddb tsubst_expr
        ../../gcc/gcc/cp/pt.c:14102
0x101f7ddb tsubst_expr
        ../../gcc/gcc/cp/pt.c:14102
0x10234bdf instantiate_decl(tree_node*, int, bool)
        ../../gcc/gcc/cp/pt.c:20586
0x10292b3b mark_used(tree_node*, int)
        ../../gcc/gcc/cp/decl2.c:5087
0x10175747 build_over_call
        ../../gcc/gcc/cp/call.c:7502
0x101882df build_op_call_1
        ../../gcc/gcc/cp/call.c:4297
0x101882df build_op_call(tree_node*, vec<tree_node*, va_gc, vl_embed>**, int)
        ../../gcc/gcc/cp/call.c:4320
0x10374c03 finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**,
bool, bool, int)
        ../../gcc/gcc/cp/semantics.c:2409
0x102cff3f cp_parser_postfix_expression
        ../../gcc/gcc/cp/parser.c:6346
0x102d3a07 cp_parser_unary_expression
        ../../gcc/gcc/cp/parser.c:7410
0x102d4eef cp_parser_binary_expression
        ../../gcc/gcc/cp/parser.c:8148
0x102d595b cp_parser_assignment_expression
        ../../gcc/gcc/cp/parser.c:8405
0x102d9633 cp_parser_expression
        ../../gcc/gcc/cp/parser.c:8559
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.

Clang accepts the code.

Reply via email to