This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/70735] [5/6/7 Regression] problem combining std::function, generic lambdas and static variables


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)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]