http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58596

            Bug ID: 58596
           Summary: [4.8/4.9 Regression] [c++11] ICE with decltype in
                    non-static data member initializer
           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 code snippet (compiled with "-std=c++11") triggers an ICE since
GCC 4.8.0:

==============================================
struct A
{
  int i = [] { return decltype(i)(); }();
};
==============================================

bug.cc: In lambda function:
bug.cc:3:32: internal compiler error: Segmentation fault
   int i = [] { return decltype(i)(); }();
                                ^
0xaef4bf crash_signal
        ../../gcc/gcc/toplev.c:335
0x54c0cd contains_struct_check
        ../../gcc/gcc/tree.h:2722
0x54c0cd build_new_op_1
        ../../gcc/gcc/cp/call.c:5154
0x54cf47 build_new_op(unsigned int, tree_code, int, tree_node*, tree_node*,
tree_node*, tree_node**, int)
        ../../gcc/gcc/cp/call.c:5513
0x672529 build_x_indirect_ref(unsigned int, tree_node*, ref_operator, int)
        ../../gcc/gcc/cp/typeck.c:2866
0x6b165a finish_non_static_data_member(tree_node*, tree_node*, tree_node*)
        ../../gcc/gcc/cp/semantics.c:1580
0x6b6b5f finish_id_expression(tree_node*, tree_node*, tree_node*, cp_id_kind*,
bool, bool, bool*, bool, bool, bool, bool, char const**, unsigned int)
        ../../gcc/gcc/cp/semantics.c:3418
0x642cfb cp_parser_decltype_expr
        ../../gcc/gcc/cp/parser.c:11653
0x642cfb cp_parser_decltype
        ../../gcc/gcc/cp/parser.c:11781
0x65a862 cp_parser_simple_type_specifier
        ../../gcc/gcc/cp/parser.c:14288
0x641fe4 cp_parser_postfix_expression
        ../../gcc/gcc/cp/parser.c:5737
0x64483d cp_parser_unary_expression
        ../../gcc/gcc/cp/parser.c:7009
0x64540f cp_parser_binary_expression
        ../../gcc/gcc/cp/parser.c:7701
0x6458cf cp_parser_assignment_expression
        ../../gcc/gcc/cp/parser.c:7937
0x647733 cp_parser_expression
        ../../gcc/gcc/cp/parser.c:8099
0x641125 cp_parser_expression
        ../../gcc/gcc/cp/parser.c:8138
0x641125 cp_parser_lambda_body
        ../../gcc/gcc/cp/parser.c:9035
0x641125 cp_parser_lambda_expression
        ../../gcc/gcc/cp/parser.c:8574
0x641125 cp_parser_primary_expression
        ../../gcc/gcc/cp/parser.c:4230
0x642050 cp_parser_postfix_expression
        ../../gcc/gcc/cp/parser.c:5814
Please submit a full bug report, [etc.]

Reply via email to