[Bug c++/60096] c++11 lambda reference capture mistake

2014-02-06 Thread feng.w...@uni-ulm.de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60096 Feng Wang changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug c++/60096] c++11 lambda reference capture mistake

2014-02-06 Thread feng.w...@uni-ulm.de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60096 --- Comment #2 from Feng Wang --- (In reply to Jonathan Wakely from comment #1) > This looks invalid to me, you return a closure that holds a dangling > reference to a function parameter that has gone out of scope. Sorry, my fault. I should have

[Bug c++/60096] New: c++11 lambda reference capture mistake

2014-02-06 Thread feng.w...@uni-ulm.de
++ Assignee: unassigned at gcc dot gnu.org Reporter: feng.w...@uni-ulm.de considering the following code: [code] #include int main() { std::cout << []( int x ) { return [&a