The C++14 standard (§5.1.2) says:
The closure type for a non-generic lambda-expression with no
lambda-capture has a public non-virtual non-explicit const conversion
function to pointer to function with C++ language linkage (7.5)
having the same parameter and return types as the closure type’s
function call operator. The value returned by this conversion function
shall be the address of a function that, when invoked, has the same
effect as invoking the closure type’s function call operator.
Since a function pointer is implicitly convertible to bool
, you get the result you have shown. This is perfectly legal.
MSVC doesn't compile this because this conversion operator is overloaded with different calling conventions (__stdcall
, __cdecl
, etc).
When compiling for x64
all those calling conventions are not used, so there's just one conversion operator and it compiles fine.