This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/70735] [5/6/7 Regression] problem combining std::function, generic lambdas and static variables
- From: "m-ou dot se at m-ou dot se" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 21 May 2016 20:26:31 +0000
- Subject: [Bug c++/70735] [5/6/7 Regression] problem combining std::function, generic lambdas and static variables
- Auto-submitted: auto-generated
- References: <bug-70735-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70735
Maurice <m-ou.se@m-ou.se> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |m-ou.se@m-ou.se
--- Comment #12 from Maurice <m-ou.se@m-ou.se> ---
It even seems to make a copy of non-copyable objects:
#include <iostream>
#include <mutex>
int main() {
static std::mutex a;
std::cout << (void*)&a << std::endl;
void (*f)(int) = [&] (auto) { std::cout << (void*)&a << std::endl; };
f(0);
}
Gave the output:
0x600e00
0x600dc0
(gcc version 6.1.1 20160501)