This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/65354] Converting lambda to pointer results in double destruction
- From: "charlie at charliedyson dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 09 Mar 2015 08:05:07 +0000
- Subject: [Bug c++/65354] Converting lambda to pointer results in double destruction
- Auto-submitted: auto-generated
- References: <bug-65354-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65354
--- Comment #2 from Charlie <charlie at charliedyson dot net> ---
Here's a more succinct example (using the "+" trick to convert to a function
pointer):
#include <iostream>
int main ()
{
auto f = +[] (std::string s)
{
return std::string (std::move (s));
};
std::string s ("hello");
f (std::move (s));
}