public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/56464] New: Crashes when using implicit this in a lambda capture in member initilizer
@ 2013-02-26 16:19 ogoffart at kde dot org
  2013-02-26 16:26 ` [Bug c++/56464] " mpolacek at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: ogoffart at kde dot org @ 2013-02-26 16:19 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 56464
           Summary: Crashes when using implicit this in a lambda capture
                    in member initilizer
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: ogoffart@kde.org


GCC segfault on this (valid) code:

struct bug { bug*a = [&](){return this;}(); };


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

* [Bug c++/56464] Crashes when using implicit this in a lambda capture in member initilizer
  2013-02-26 16:19 [Bug c++/56464] New: Crashes when using implicit this in a lambda capture in member initilizer ogoffart at kde dot org
@ 2013-02-26 16:26 ` mpolacek at gcc dot gnu.org
  2013-02-26 16:33 ` [Bug c++/56464] Crashes when using implicit this in a lambda capture in member initializer redi at gcc dot gnu.org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2013-02-26 16:26 UTC (permalink / raw)
  To: gcc-bugs


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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mpolacek at gcc dot gnu.org

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> 2013-02-26 16:26:00 UTC ---
With trunk (may be a dup, there are a lot of lambda-related crashes):

lam.C:1:35: internal compiler error: Segmentation fault
 struct bug { bug*a = [&](){return this;}(); };
                                   ^
0xc495e1 crash_signal
    /home/marek/src/gcc/gcc/toplev.c:332
0x54b550 tree_not_check2(tree_node*, char const*, int, char const*, tree_code,
tree_code)
    /home/marek/src/gcc/gcc/tree.h:3706
0x71390e lambda_expr_this_capture(tree_node*)
    /home/marek/src/gcc/gcc/cp/semantics.c:9450
0x6f5c8b finish_this_expr()
    /home/marek/src/gcc/gcc/cp/semantics.c:2295
0x663afe cp_parser_primary_expression
    /home/marek/src/gcc/gcc/cp/parser.c:4133
0x666731 cp_parser_postfix_expression
    /home/marek/src/gcc/gcc/cp/parser.c:5629
0x6687d6 cp_parser_unary_expression
    /home/marek/src/gcc/gcc/cp/parser.c:6685
0x669337 cp_parser_cast_expression
    /home/marek/src/gcc/gcc/cp/parser.c:7266
0x669394 cp_parser_binary_expression
    /home/marek/src/gcc/gcc/cp/parser.c:7365
0x669a0a cp_parser_assignment_expression
    /home/marek/src/gcc/gcc/cp/parser.c:7590
0x669c34 cp_parser_expression
    /home/marek/src/gcc/gcc/cp/parser.c:7741
0x66b7a3 cp_parser_lambda_body
    /home/marek/src/gcc/gcc/cp/parser.c:8632
0x66a62a cp_parser_lambda_expression
    /home/marek/src/gcc/gcc/cp/parser.c:8194
0x66397e cp_parser_primary_expression
    /home/marek/src/gcc/gcc/cp/parser.c:4085
0x666731 cp_parser_postfix_expression
    /home/marek/src/gcc/gcc/cp/parser.c:5629
0x6687d6 cp_parser_unary_expression
    /home/marek/src/gcc/gcc/cp/parser.c:6685
0x669337 cp_parser_cast_expression
    /home/marek/src/gcc/gcc/cp/parser.c:7266
0x669394 cp_parser_binary_expression
    /home/marek/src/gcc/gcc/cp/parser.c:7365
0x669a0a cp_parser_assignment_expression
    /home/marek/src/gcc/gcc/cp/parser.c:7590
0x669d4f cp_parser_constant_expression
    /home/marek/src/gcc/gcc/cp/parser.c:7821
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.


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

* [Bug c++/56464] Crashes when using implicit this in a lambda capture in member initializer
  2013-02-26 16:19 [Bug c++/56464] New: Crashes when using implicit this in a lambda capture in member initilizer ogoffart at kde dot org
  2013-02-26 16:26 ` [Bug c++/56464] " mpolacek at gcc dot gnu.org
@ 2013-02-26 16:33 ` redi at gcc dot gnu.org
  2013-02-27 10:22 ` paolo.carlini at oracle dot com
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: redi at gcc dot gnu.org @ 2013-02-26 16:33 UTC (permalink / raw)
  To: gcc-bugs


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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-02-26
             Blocks|                            |54367
            Summary|Crashes when using implicit |Crashes when using implicit
                   |this in a lambda capture in |this in a lambda capture in
                   |member initilizer           |member initializer
     Ever Confirmed|0                           |1


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

* [Bug c++/56464] Crashes when using implicit this in a lambda capture in member initializer
  2013-02-26 16:19 [Bug c++/56464] New: Crashes when using implicit this in a lambda capture in member initilizer ogoffart at kde dot org
  2013-02-26 16:26 ` [Bug c++/56464] " mpolacek at gcc dot gnu.org
  2013-02-26 16:33 ` [Bug c++/56464] Crashes when using implicit this in a lambda capture in member initializer redi at gcc dot gnu.org
@ 2013-02-27 10:22 ` paolo.carlini at oracle dot com
  2013-02-27 10:25 ` paolo.carlini at oracle dot com
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-02-27 10:22 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE

--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> 2013-02-27 10:21:37 UTC ---
Right now we don't have that many left, but this one is a Dup of PR54383.

*** This bug has been marked as a duplicate of bug 53383 ***


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

* [Bug c++/56464] Crashes when using implicit this in a lambda capture in member initializer
  2013-02-26 16:19 [Bug c++/56464] New: Crashes when using implicit this in a lambda capture in member initilizer ogoffart at kde dot org
                   ` (2 preceding siblings ...)
  2013-02-27 10:22 ` paolo.carlini at oracle dot com
@ 2013-02-27 10:25 ` paolo.carlini at oracle dot com
  2013-03-02 15:17 ` poenitz at htwm dot de
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-02-27 10:25 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> 2013-02-27 10:24:21 UTC ---


*** This bug has been marked as a duplicate of bug 54383 ***


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

* [Bug c++/56464] Crashes when using implicit this in a lambda capture in member initializer
  2013-02-26 16:19 [Bug c++/56464] New: Crashes when using implicit this in a lambda capture in member initilizer ogoffart at kde dot org
                   ` (3 preceding siblings ...)
  2013-02-27 10:25 ` paolo.carlini at oracle dot com
@ 2013-03-02 15:17 ` poenitz at htwm dot de
  2013-03-02 22:21 ` redi at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: poenitz at htwm dot de @ 2013-03-02 15:17 UTC (permalink / raw)
  To: gcc-bugs


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

poenitz at htwm dot de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |poenitz at htwm dot de

--- Comment #4 from poenitz at htwm dot de 2013-03-02 15:16:54 UTC ---
I am afraid I don't understand the process. How can an "ice-on-valid-code" be a
duplicate of a "ice-on-invalid-code"? Yes, the cause for the crash might
technically be the same, but in the other case it might be covered by
"undefined behaviour", here not.


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

* [Bug c++/56464] Crashes when using implicit this in a lambda capture in member initializer
  2013-02-26 16:19 [Bug c++/56464] New: Crashes when using implicit this in a lambda capture in member initilizer ogoffart at kde dot org
                   ` (4 preceding siblings ...)
  2013-03-02 15:17 ` poenitz at htwm dot de
@ 2013-03-02 22:21 ` redi at gcc dot gnu.org
  2013-03-04  3:13 ` jason at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: redi at gcc dot gnu.org @ 2013-03-02 22:21 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> 2013-03-02 22:20:44 UTC ---
That one's easy, it can be both ice-on-valid-code and ice-on-invalid-code

If it crashes in the same place and is fixed by the same fix, it's the same
bug, no?


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

* [Bug c++/56464] Crashes when using implicit this in a lambda capture in member initializer
  2013-02-26 16:19 [Bug c++/56464] New: Crashes when using implicit this in a lambda capture in member initilizer ogoffart at kde dot org
                   ` (5 preceding siblings ...)
  2013-03-02 22:21 ` redi at gcc dot gnu.org
@ 2013-03-04  3:13 ` jason at gcc dot gnu.org
  2013-03-04  9:45 ` [Bug c++/56464] [C++11] " paolo.carlini at oracle dot com
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jason at gcc dot gnu.org @ 2013-03-04  3:13 UTC (permalink / raw)
  To: gcc-bugs


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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |NEW
                 CC|                            |jason at gcc dot gnu.org
         Resolution|DUPLICATE                   |

--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> 2013-03-04 03:12:05 UTC ---
Not a duplicate.  54367 is the case where there is no 'this', this bug is the
case where 'this' is for a NSDMI.


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

* [Bug c++/56464] [C++11] Crashes when using implicit this in a lambda capture in member initializer
  2013-02-26 16:19 [Bug c++/56464] New: Crashes when using implicit this in a lambda capture in member initilizer ogoffart at kde dot org
                   ` (6 preceding siblings ...)
  2013-03-04  3:13 ` jason at gcc dot gnu.org
@ 2013-03-04  9:45 ` paolo.carlini at oracle dot com
  2013-03-04 17:14 ` jason at gcc dot gnu.org
  2013-03-04 17:15 ` jason at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-03-04  9:45 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #7 from Paolo Carlini <paolo.carlini at oracle dot com> 2013-03-04 09:45:14 UTC ---
Sorry, I didn't notice that in 54383 we aren't in a class.


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

* [Bug c++/56464] [C++11] Crashes when using implicit this in a lambda capture in member initializer
  2013-02-26 16:19 [Bug c++/56464] New: Crashes when using implicit this in a lambda capture in member initilizer ogoffart at kde dot org
                   ` (7 preceding siblings ...)
  2013-03-04  9:45 ` [Bug c++/56464] [C++11] " paolo.carlini at oracle dot com
@ 2013-03-04 17:14 ` jason at gcc dot gnu.org
  2013-03-04 17:15 ` jason at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: jason at gcc dot gnu.org @ 2013-03-04 17:14 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #8 from Jason Merrill <jason at gcc dot gnu.org> 2013-03-04 17:12:47 UTC ---
Author: jason
Date: Mon Mar  4 17:12:32 2013
New Revision: 196437

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=196437
Log:
    PR c++/56464
    PR c++/54383
    * semantics.c (lambda_expr_this_capture): Handle NSDMI
    and non-class scopes.

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


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

* [Bug c++/56464] [C++11] Crashes when using implicit this in a lambda capture in member initializer
  2013-02-26 16:19 [Bug c++/56464] New: Crashes when using implicit this in a lambda capture in member initilizer ogoffart at kde dot org
                   ` (8 preceding siblings ...)
  2013-03-04 17:14 ` jason at gcc dot gnu.org
@ 2013-03-04 17:15 ` jason at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: jason at gcc dot gnu.org @ 2013-03-04 17:15 UTC (permalink / raw)
  To: gcc-bugs


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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
         AssignedTo|unassigned at gcc dot       |jason at gcc dot gnu.org
                   |gnu.org                     |
   Target Milestone|---                         |4.8.0

--- Comment #9 from Jason Merrill <jason at gcc dot gnu.org> 2013-03-04 17:14:22 UTC ---
Fixed for 4.8.


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

end of thread, other threads:[~2013-03-04 17:15 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-26 16:19 [Bug c++/56464] New: Crashes when using implicit this in a lambda capture in member initilizer ogoffart at kde dot org
2013-02-26 16:26 ` [Bug c++/56464] " mpolacek at gcc dot gnu.org
2013-02-26 16:33 ` [Bug c++/56464] Crashes when using implicit this in a lambda capture in member initializer redi at gcc dot gnu.org
2013-02-27 10:22 ` paolo.carlini at oracle dot com
2013-02-27 10:25 ` paolo.carlini at oracle dot com
2013-03-02 15:17 ` poenitz at htwm dot de
2013-03-02 22:21 ` redi at gcc dot gnu.org
2013-03-04  3:13 ` jason at gcc dot gnu.org
2013-03-04  9:45 ` [Bug c++/56464] [C++11] " paolo.carlini at oracle dot com
2013-03-04 17:14 ` jason at gcc dot gnu.org
2013-03-04 17:15 ` jason at gcc dot gnu.org

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