public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/65727] New: Segfault With Decltype In Lambda Expression Used To Initialize Static Class Member
@ 2015-04-10  1:19 mmccurry at gatech dot edu
  2015-04-10  7:44 ` [Bug c++/65727] [4.8/4.9/5 Regression] " mpolacek at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: mmccurry at gatech dot edu @ 2015-04-10  1:19 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 65727
           Summary: Segfault With Decltype In Lambda Expression Used To
                    Initialize Static Class Member
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mmccurry at gatech dot edu

Created attachment 35284
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35284&action=edit
Minimal Test Case

Using version 4.8.2 of g++ in an x86 environment, a segfault is possible with
the attached code

The build of this compiler was performed via the following slackware build
script
ftp://ftp.slackware.com/pub/slackware/slackware-14.1/source/d/gcc/gcc.SlackBuild

When the file is built, the following output is produced:

---------------------------------------------------
$ g++ -std=c++11 gcc-4.8.2-bug.cpp 
gcc-4.8.2-bug.cpp: In lambda function:
gcc-4.8.2-bug.cpp:22:55: internal compiler error: Segmentation fault
 type_b type_e::b = {{[](){decltype(function_c(type_e::d))::dummy();}}};
                                                       ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
---------------------------------------------------

It looks like there are some similar bugs which have been fixed in the past,
but none of them seem to have the same requirements as this segfault.
Additionally the codebase which produced this issue has been reported to
produce segfaults in version 4.9.1 though it is unknown if this minimal test
case produces the segfault in the more recent versions.


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

* [Bug c++/65727] [4.8/4.9/5 Regression] Segfault With Decltype In Lambda Expression Used To Initialize Static Class Member
  2015-04-10  1:19 [Bug c++/65727] New: Segfault With Decltype In Lambda Expression Used To Initialize Static Class Member mmccurry at gatech dot edu
@ 2015-04-10  7:44 ` mpolacek at gcc dot gnu.org
  2015-04-10  7:47 ` rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-04-10  7:44 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-04-10
                 CC|                            |mpolacek at gcc dot gnu.org
   Target Milestone|---                         |4.8.5
            Summary|Segfault With Decltype In   |[4.8/4.9/5 Regression]
                   |Lambda Expression Used To   |Segfault With Decltype In
                   |Initialize Static Class     |Lambda Expression Used To
                   |Member                      |Initialize Static Class
                   |                            |Member
     Ever confirmed|0                           |1

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Confirmed with 4.8/4.9/5.  4.7 was ok.


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

* [Bug c++/65727] [4.8/4.9/5 Regression] Segfault With Decltype In Lambda Expression Used To Initialize Static Class Member
  2015-04-10  1:19 [Bug c++/65727] New: Segfault With Decltype In Lambda Expression Used To Initialize Static Class Member mmccurry at gatech dot edu
  2015-04-10  7:44 ` [Bug c++/65727] [4.8/4.9/5 Regression] " mpolacek at gcc dot gnu.org
@ 2015-04-10  7:47 ` rguenth at gcc dot gnu.org
  2015-04-11 15:04 ` jason at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-04-10  7:47 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
           Priority|P3                          |P2


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

* [Bug c++/65727] [4.8/4.9/5 Regression] Segfault With Decltype In Lambda Expression Used To Initialize Static Class Member
  2015-04-10  1:19 [Bug c++/65727] New: Segfault With Decltype In Lambda Expression Used To Initialize Static Class Member mmccurry at gatech dot edu
  2015-04-10  7:44 ` [Bug c++/65727] [4.8/4.9/5 Regression] " mpolacek at gcc dot gnu.org
  2015-04-10  7:47 ` rguenth at gcc dot gnu.org
@ 2015-04-11 15:04 ` jason at gcc dot gnu.org
  2015-04-15 21:17 ` [Bug c++/65727] [4.8/4.9/5/6 " jason at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2015-04-11 15:04 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |jason at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |jason at gcc dot gnu.org


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

* [Bug c++/65727] [4.8/4.9/5/6 Regression] Segfault With Decltype In Lambda Expression Used To Initialize Static Class Member
  2015-04-10  1:19 [Bug c++/65727] New: Segfault With Decltype In Lambda Expression Used To Initialize Static Class Member mmccurry at gatech dot edu
                   ` (2 preceding siblings ...)
  2015-04-11 15:04 ` jason at gcc dot gnu.org
@ 2015-04-15 21:17 ` jason at gcc dot gnu.org
  2015-04-22 20:53 ` jason at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2015-04-15 21:17 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Wed Apr 15 21:17:03 2015
New Revision: 222132

URL: https://gcc.gnu.org/viewcvs?rev=222132&root=gcc&view=rev
Log:
    PR c++/65727
    * lambda.c (lambda_expr_this_capture): In unevaluated context go
    through the normal loop, just don't capture.
    (maybe_resolve_dummy): Handle null return.

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


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

* [Bug c++/65727] [4.8/4.9/5/6 Regression] Segfault With Decltype In Lambda Expression Used To Initialize Static Class Member
  2015-04-10  1:19 [Bug c++/65727] New: Segfault With Decltype In Lambda Expression Used To Initialize Static Class Member mmccurry at gatech dot edu
                   ` (3 preceding siblings ...)
  2015-04-15 21:17 ` [Bug c++/65727] [4.8/4.9/5/6 " jason at gcc dot gnu.org
@ 2015-04-22 20:53 ` jason at gcc dot gnu.org
  2015-04-23 13:20 ` jason at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2015-04-22 20:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Wed Apr 22 20:53:07 2015
New Revision: 222340

URL: https://gcc.gnu.org/viewcvs?rev=222340&root=gcc&view=rev
Log:
    PR c++/65727
    * lambda.c (maybe_resolve_dummy): Handle null return.

Added:
    branches/gcc-5-branch/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-decltype2.C
Modified:
    branches/gcc-5-branch/gcc/cp/ChangeLog
    branches/gcc-5-branch/gcc/cp/lambda.c


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

* [Bug c++/65727] [4.8/4.9/5/6 Regression] Segfault With Decltype In Lambda Expression Used To Initialize Static Class Member
  2015-04-10  1:19 [Bug c++/65727] New: Segfault With Decltype In Lambda Expression Used To Initialize Static Class Member mmccurry at gatech dot edu
                   ` (4 preceding siblings ...)
  2015-04-22 20:53 ` jason at gcc dot gnu.org
@ 2015-04-23 13:20 ` jason at gcc dot gnu.org
  2015-04-23 13:21 ` jason at gcc dot gnu.org
  2015-04-23 13:22 ` jason at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2015-04-23 13:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Thu Apr 23 13:20:14 2015
New Revision: 222364

URL: https://gcc.gnu.org/viewcvs?rev=222364&root=gcc&view=rev
Log:
    PR c++/65727
    * semantics.c (maybe_resolve_dummy): Handle null return.

Added:
   
branches/gcc-4_8-branch/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-decltype2.C
Modified:
    branches/gcc-4_8-branch/gcc/cp/ChangeLog
    branches/gcc-4_8-branch/gcc/cp/semantics.c
    branches/gcc-4_8-branch/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice3.C


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

* [Bug c++/65727] [4.8/4.9/5/6 Regression] Segfault With Decltype In Lambda Expression Used To Initialize Static Class Member
  2015-04-10  1:19 [Bug c++/65727] New: Segfault With Decltype In Lambda Expression Used To Initialize Static Class Member mmccurry at gatech dot edu
                   ` (5 preceding siblings ...)
  2015-04-23 13:20 ` jason at gcc dot gnu.org
@ 2015-04-23 13:21 ` jason at gcc dot gnu.org
  2015-04-23 13:22 ` jason at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2015-04-23 13:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Thu Apr 23 13:21:22 2015
New Revision: 222368

URL: https://gcc.gnu.org/viewcvs?rev=222368&root=gcc&view=rev
Log:
    PR c++/65727
    * lambda.c (maybe_resolve_dummy): Handle null return.

Added:
   
branches/gcc-4_9-branch/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-decltype2.C
Modified:
    branches/gcc-4_9-branch/gcc/cp/ChangeLog
    branches/gcc-4_9-branch/gcc/cp/lambda.c
    branches/gcc-4_9-branch/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice3.C


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

* [Bug c++/65727] [4.8/4.9/5/6 Regression] Segfault With Decltype In Lambda Expression Used To Initialize Static Class Member
  2015-04-10  1:19 [Bug c++/65727] New: Segfault With Decltype In Lambda Expression Used To Initialize Static Class Member mmccurry at gatech dot edu
                   ` (6 preceding siblings ...)
  2015-04-23 13:21 ` jason at gcc dot gnu.org
@ 2015-04-23 13:22 ` jason at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2015-04-23 13:22 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #7 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed for 4.8.5/4.9.3/5.2/6.


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

end of thread, other threads:[~2015-04-23 13:22 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-10  1:19 [Bug c++/65727] New: Segfault With Decltype In Lambda Expression Used To Initialize Static Class Member mmccurry at gatech dot edu
2015-04-10  7:44 ` [Bug c++/65727] [4.8/4.9/5 Regression] " mpolacek at gcc dot gnu.org
2015-04-10  7:47 ` rguenth at gcc dot gnu.org
2015-04-11 15:04 ` jason at gcc dot gnu.org
2015-04-15 21:17 ` [Bug c++/65727] [4.8/4.9/5/6 " jason at gcc dot gnu.org
2015-04-22 20:53 ` jason at gcc dot gnu.org
2015-04-23 13:20 ` jason at gcc dot gnu.org
2015-04-23 13:21 ` jason at gcc dot gnu.org
2015-04-23 13:22 ` 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).