public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/58566] New: [c++0x] ICE with invalid expression in lambda body
@ 2013-09-28 19:35 reichelt at gcc dot gnu.org
  2013-09-28 19:37 ` [Bug c++/58566] [c++11] " paolo.carlini at oracle dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: reichelt at gcc dot gnu.org @ 2013-09-28 19:35 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 58566
           Summary: [c++0x] ICE with invalid expression in lambda body
           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 invalid code snippet (compiled with "-std=c++0x") triggers an ICE
since GCC 4.8.0:

=================================
struct A
{
  int foo()
  {
    [this]{ return foo; };
  }
};
=================================

bug.cc: In lambda function:
bug.cc:5:25: error: invalid use of member function (did you forget the '()' ?)
     [this]{ return foo; };
                         ^
bug.cc:5:25: internal compiler error: in check_return_expr, at cp/typeck.c:8159
0x64d09a check_return_expr(tree_node*, bool*)
        ../../gcc-4.8.0/gcc/cp/typeck.c:8159
0x68856e finish_return_stmt(tree_node*)
        ../../gcc-4.8.0/gcc/cp/semantics.c:782
0x61a92c cp_parser_lambda_body
        ../../gcc-4.8.0/gcc/cp/parser.c:8643
0x61a92c cp_parser_lambda_expression
        ../../gcc-4.8.0/gcc/cp/parser.c:8194
0x61a92c cp_parser_primary_expression
        ../../gcc-4.8.0/gcc/cp/parser.c:4085
0x61b82a cp_parser_postfix_expression
        ../../gcc-4.8.0/gcc/cp/parser.c:5629
0x61dd3a cp_parser_unary_expression
        ../../gcc-4.8.0/gcc/cp/parser.c:6685
0x61e8d7 cp_parser_binary_expression
        ../../gcc-4.8.0/gcc/cp/parser.c:7365
0x61ed65 cp_parser_assignment_expression
        ../../gcc-4.8.0/gcc/cp/parser.c:7590
0x620b82 cp_parser_expression
        ../../gcc-4.8.0/gcc/cp/parser.c:7741
0x62124a cp_parser_expression_statement
        ../../gcc-4.8.0/gcc/cp/parser.c:9021
0x6172e7 cp_parser_statement
        ../../gcc-4.8.0/gcc/cp/parser.c:8873
0x61856e cp_parser_statement_seq_opt
        ../../gcc-4.8.0/gcc/cp/parser.c:9139
0x6186b6 cp_parser_compound_statement
        ../../gcc-4.8.0/gcc/cp/parser.c:9093
0x6297e3 cp_parser_function_body
        ../../gcc-4.8.0/gcc/cp/parser.c:17680
0x6297e3 cp_parser_ctor_initializer_opt_and_function_body
        ../../gcc-4.8.0/gcc/cp/parser.c:17716
0x62a86f cp_parser_function_definition_after_declarator
        ../../gcc-4.8.0/gcc/cp/parser.c:21691
0x6112dc cp_parser_late_parsing_for_member
        ../../gcc-4.8.0/gcc/cp/parser.c:22332
0x6112dc cp_parser_class_specifier_1
        ../../gcc-4.8.0/gcc/cp/parser.c:18439
0x6112dc cp_parser_class_specifier
        ../../gcc-4.8.0/gcc/cp/parser.c:18463
Please submit a full bug report, [etc.]


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-10-12  8:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-28 19:35 [Bug c++/58566] New: [c++0x] ICE with invalid expression in lambda body reichelt at gcc dot gnu.org
2013-09-28 19:37 ` [Bug c++/58566] [c++11] " paolo.carlini at oracle dot com
2015-09-25 20:40 ` zeccav at gmail dot com
2015-10-11 17:05 ` ville.voutilainen at gmail dot com
2015-10-11 17:30 ` ville.voutilainen at gmail dot com
2015-10-12  8:55 ` ville at gcc dot gnu.org
2015-10-12  8:56 ` ville.voutilainen at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).