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

* [Bug c++/58566] [c++11] ICE with invalid expression in lambda body
  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 ` paolo.carlini at oracle dot com
  2015-09-25 20:40 ` zeccav at gmail dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-09-28 19:37 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[c++0x] ICE with invalid    |[c++11] ICE with invalid
                   |expression in lambda body   |expression in lambda body

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Please don't refer anymore to c++0x/C++0x, by now it's legacy.


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

* [Bug c++/58566] [c++11] ICE with invalid expression in lambda body
  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
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: zeccav at gmail dot com @ 2015-09-25 20:40 UTC (permalink / raw)
  To: gcc-bugs

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

Vittorio Zecca <zeccav at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |zeccav at gmail dot com

--- Comment #2 from Vittorio Zecca <zeccav at gmail dot com> ---
Still fails on 6.0.0 trunk

~/gcc-trunk/bin/g++ -S p1.C -std=c++11
p1.C: In lambda function:
p1.C:5:25: error: invalid use of member function (did you forget the ‘()’ ?)
     [this]{ return foo; };
                         ^
p1.C:5:25: internal compiler error: in check_return_expr, at cp/typeck.c:8609
0x729126 check_return_expr(tree_node*, bool*)
        ../../gcc/gcc/cp/typeck.c:8609
0x7663fe finish_return_stmt(tree_node*)
        ../../gcc/gcc/cp/semantics.c:873
0x70d5c4 cp_parser_lambda_body
        ../../gcc/gcc/cp/parser.c:9636
0x70d5c4 cp_parser_lambda_expression
        ../../gcc/gcc/cp/parser.c:9141
0x6df257 cp_parser_primary_expression
        ../../gcc/gcc/cp/parser.c:4510
0x6eb64b cp_parser_postfix_expression
        ../../gcc/gcc/cp/parser.c:6201
0x6f00a9 cp_parser_unary_expression
        ../../gcc/gcc/cp/parser.c:7486
0x6f0ce7 cp_parser_binary_expression
        ../../gcc/gcc/cp/parser.c:8223
0x6f13ef cp_parser_assignment_expression
        ../../gcc/gcc/cp/parser.c:8481
0x6f9b61 cp_parser_expression
        ../../gcc/gcc/cp/parser.c:8635
0x6fb6c6 cp_parser_expression_statement
        ../../gcc/gcc/cp/parser.c:10049
0x706ae5 cp_parser_statement
        ../../gcc/gcc/cp/parser.c:9900
0x7076a2 cp_parser_statement_seq_opt
        ../../gcc/gcc/cp/parser.c:10172
0x70780b cp_parser_compound_statement
        ../../gcc/gcc/cp/parser.c:10126
0x707a1b cp_parser_function_body
        ../../gcc/gcc/cp/parser.c:19785
0x707a1b cp_parser_ctor_initializer_opt_and_function_body
        ../../gcc/gcc/cp/parser.c:19821
0x708899 cp_parser_function_definition_after_declarator
        ../../gcc/gcc/cp/parser.c:24428
0x70c45c cp_parser_late_parsing_for_member
        ../../gcc/gcc/cp/parser.c:25232
0x6e7cc1 cp_parser_class_specifier_1
        ../../gcc/gcc/cp/parser.c:20645
0x6e7cc1 cp_parser_class_specifier
        ../../gcc/gcc/cp/parser.c:20671
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.
>From gcc-bugs-return-498061-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Sep 25 21:06:47 2015
Return-Path: <gcc-bugs-return-498061-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 65330 invoked by alias); 25 Sep 2015 21:06:47 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 65242 invoked by uid 55); 25 Sep 2015 21:06:42 -0000
From: "vmakarov at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/61578] [4.9 regression] Code size increase for ARM thumb compared to 4.8.x when compiling with -Os
Date: Fri, 25 Sep 2015 21:06:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: vmakarov at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P2
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.9.4
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-61578-4-I8l75pQ8H7@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-61578-4@http.gcc.gnu.org/bugzilla/>
References: <bug-61578-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-09/txt/msg02039.txt.bz2
Content-length: 516

https://gcc.gnu.org/bugzilla/show_bug.cgi?ida578

--- Comment #33 from Vladimir Makarov <vmakarov at gcc dot gnu.org> ---
Author: vmakarov
Date: Fri Sep 25 21:06:08 2015
New Revision: 228153

URL: https://gcc.gnu.org/viewcvs?rev"8153&root=gcc&view=rev
Log:
2015-09-25  Vladimir Makarov  <vmakarov@redhat.com>

        PR target/61578
        * lra-constarints.c (match_reload): Check presence of the input pseudo
        in the output pseudo.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/lra-constraints.c


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

* [Bug c++/58566] [c++11] ICE with invalid expression in lambda body
  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
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: ville.voutilainen at gmail dot com @ 2015-10-11 17:05 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Ville Voutilainen <ville.voutilainen at gmail dot com> ---
Patch available: https://gcc.gnu.org/ml/gcc-patches/2015-10/msg01075.html


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

* [Bug c++/58566] [c++11] ICE with invalid expression in lambda body
  2013-09-28 19:35 [Bug c++/58566] New: [c++0x] ICE with invalid expression in lambda body reichelt at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  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
  5 siblings, 0 replies; 7+ messages in thread
From: ville.voutilainen at gmail dot com @ 2015-10-11 17:30 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Ville Voutilainen <ville.voutilainen at gmail dot com> ---
Ahem, make that https://gcc.gnu.org/ml/gcc-patches/2015-10/msg01076.html


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

* [Bug c++/58566] [c++11] ICE with invalid expression in lambda body
  2013-09-28 19:35 [Bug c++/58566] New: [c++0x] ICE with invalid expression in lambda body reichelt at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  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
  5 siblings, 0 replies; 7+ messages in thread
From: ville at gcc dot gnu.org @ 2015-10-12  8:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from ville at gcc dot gnu.org ---
Author: ville
Date: Mon Oct 12 08:55:19 2015
New Revision: 228706

URL: https://gcc.gnu.org/viewcvs?rev=228706&root=gcc&view=rev
Log:
PR c++/58566

/cp
2015-10-12  Ville Voutilainen  <ville.voutilainen@gmail.com>

        PR c++/58566
        * lambda.c (lambda_return_type): Return error_mark_node
        instead of void_type_node for the error cases.

/testsuite
2015-10-12  Ville Voutilainen  <ville.voutilainen@gmail.com>

        PR c++/58566
        * g++.dg/cpp0x/lambda/lambda-58566.C: New.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-58566.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/lambda.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/58566] [c++11] ICE with invalid expression in lambda body
  2013-09-28 19:35 [Bug c++/58566] New: [c++0x] ICE with invalid expression in lambda body reichelt at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2015-10-12  8:55 ` ville at gcc dot gnu.org
@ 2015-10-12  8:56 ` ville.voutilainen at gmail dot com
  5 siblings, 0 replies; 7+ messages in thread
From: ville.voutilainen at gmail dot com @ 2015-10-12  8:56 UTC (permalink / raw)
  To: gcc-bugs

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

Ville Voutilainen <ville.voutilainen at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #7 from Ville Voutilainen <ville.voutilainen at gmail dot com> ---
Fixed on trunk.


^ 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).