For the last few days, I have been debugging a weird issue involving lambdas in C++. I have reduced the problem down to the following symptoms:
This seems to be a compiler bug in gcc 6.2, see:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77686
Workarounds:
-fno-schedule-insns2
-O2