public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/47212] New: [C++0x] crash on lambda returning lambda
@ 2011-01-07 15:00 a71104 at gmail dot com
  2011-01-07 15:28 ` [Bug c++/47212] " redi at gcc dot gnu.org
  2011-05-27 17:28 ` jason at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: a71104 at gmail dot com @ 2011-01-07 15:00 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: [C++0x] crash on lambda returning lambda
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: a71104@gmail.com


Here's the code:



==============================================

#include <iostream>
using namespace std;

auto test = [] () {
    return [] (istream &ris) -> istream& {
        return ris;
    };
};

int main() {
    cin >> test();
    return 0;
}

==============================================



I'm not sure whether this code is correct but it just crashes g++ 4.5.0.
I'm compiling with:

g++ -std=c++0x -pedantic -Wall Test.cpp



I'm doing code like that because I wish to implement a custom parameterized I/O
manipulator without using implementation-specific types such as smanip and
stuff.
Note that it doesn't crash if I just call test() without using the result on
cin, thus I think the problem is matching the returned lambda against the
version of operator >> that takes a function as an argument.

PS: I don't think there's any difference but I'm using MinGW and I'm currently
unable to test on Linux with real g++.


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

* [Bug c++/47212] [C++0x] crash on lambda returning lambda
  2011-01-07 15:00 [Bug c++/47212] New: [C++0x] crash on lambda returning lambda a71104 at gmail dot com
@ 2011-01-07 15:28 ` redi at gcc dot gnu.org
  2011-05-27 17:28 ` jason at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: redi at gcc dot gnu.org @ 2011-01-07 15:28 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011.01.07 15:00:27
     Ever Confirmed|0                           |1
      Known to fail|                            |4.5.2, 4.6.0
           Severity|major                       |normal

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-01-07 15:00:27 UTC ---
fails on Linux too, it's not a target-specific problem


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

* [Bug c++/47212] [C++0x] crash on lambda returning lambda
  2011-01-07 15:00 [Bug c++/47212] New: [C++0x] crash on lambda returning lambda a71104 at gmail dot com
  2011-01-07 15:28 ` [Bug c++/47212] " redi at gcc dot gnu.org
@ 2011-05-27 17:28 ` jason at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: jason at gcc dot gnu.org @ 2011-05-27 17:28 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> 2011-05-27 17:24:48 UTC ---
I'm looking at this issue.

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


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

end of thread, other threads:[~2011-05-27 17:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-07 15:00 [Bug c++/47212] New: [C++0x] crash on lambda returning lambda a71104 at gmail dot com
2011-01-07 15:28 ` [Bug c++/47212] " redi at gcc dot gnu.org
2011-05-27 17:28 ` 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).