[boost] Lambda testcase fails when optimization enabled in gcc and llvm