[Bug c++/70735] [5/6/7 Regression] problem combining std::function, generic lambdas and static variables
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Apr 20 14:13:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70735
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |NEW
Component|libstdc++ |c++
Assignee|redi at gcc dot gnu.org |unassigned at gcc dot gnu.org
--- Comment #9 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Although that change just makes a latent bug apparent, this doesn't use
std::function and still fails the same way:
extern "C" int printf(const char*, ...);
int main()
{
static int a;
void(*f)(int) = [](auto) { printf("%d\n", a); };
a = 1;
f(0);
}
This has always failed, so isn't a regression, but for some reason the library
change in r232274 now hits this bug.
More information about the Gcc-bugs
mailing list