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



             Bug #: 56692

           Summary: [4.8 Regression] [C++11] Segmentation fault when

                    calling static/non-static overloaded function from

                    lambda

    Classification: Unclassified

           Product: gcc

           Version: 4.8.0

            Status: UNCONFIRMED

          Severity: normal

          Priority: P3

         Component: c++

        AssignedTo: unassig...@gcc.gnu.org

        ReportedBy: b...@mm.beanwood.com





The following causes an "Internal compiler error: Segmentation fault" in GCC

4.8.0 when compiled with 'g++ -std=c++11':



struct Class {

        void f () { }

        static void f (int) { }

};



int main ()

{

        [] () { Class::f(0); };

}



This does not segfault in 4.7.2.  Removing the non-static f declaration

prevents the segfault.



gcc was compiled with no configure arguments. The system is i686-pc-linux-gnu. 

Here's the complete error message, including stack trace:



t.c: In lambda function:

t.c:8:17: internal compiler error: Segmentation fault

  [] () { Class::f(0); };

                 ^

0x84edeb1 crash_signal

        ../.././gcc/toplev.c:332

0x81c64c9 lookup_base(tree_node*, tree_node*, int, base_kind*, int)

        ../.././gcc/cp/search.c:199

0x81d276c finish_qualified_id_expr(tree_node*, tree_node*, bool, bool, bool,

bool)

        ../.././gcc/cp/semantics.c:1786

0x81d32a3 finish_id_expression(tree_node*, tree_node*, tree_node*, cp_id_kind*,

bool                                                , bool, bool*, bool, bool,

bool, bool, char const**, unsigned int)

        ../.././gcc/cp/semantics.c:3348

0x8187f06 cp_parser_primary_expression

        ../.././gcc/cp/parser.c:4394

0x81892d9 cp_parser_postfix_expression

        ../.././gcc/cp/parser.c:5629

0x818b223 cp_parser_unary_expression

        ../.././gcc/cp/parser.c:6685

0x818bcf5 cp_parser_binary_expression

        ../.././gcc/cp/parser.c:7365

0x818c1d0 cp_parser_assignment_expression

        ../.././gcc/cp/parser.c:7590

0x818dd8c cp_parser_expression

        ../.././gcc/cp/parser.c:7741

0x818e3fd cp_parser_expression_statement

        ../.././gcc/cp/parser.c:9021

0x8185717 cp_parser_statement

        ../.././gcc/cp/parser.c:8873

0x81869d5 cp_parser_statement_seq_opt

        ../.././gcc/cp/parser.c:9139

0x8187ceb cp_parser_lambda_body

        ../.././gcc/cp/parser.c:8653

0x8187ceb cp_parser_lambda_expression

        ../.././gcc/cp/parser.c:8194

0x8187ceb cp_parser_primary_expression

        ../.././gcc/cp/parser.c:4085

0x81892d9 cp_parser_postfix_expression

        ../.././gcc/cp/parser.c:5629

0x818b223 cp_parser_unary_expression

        ../.././gcc/cp/parser.c:6685

0x818bcf5 cp_parser_binary_expression

        ../.././gcc/cp/parser.c:7365

0x818c1d0 cp_parser_assignment_expression

        ../.././gcc/cp/parser.c:7590



Thanks!

Reply via email to