Community
Participate
Working Groups
The parser is unable to properly resolve function call, to a function which takes a function pointer as argument, with a lambda expression as argument when, the lambda has argument of auto type and its return type depends on argument type: struct Obj { bool bmem; }; class ObjPtr { public: const Obj* operator->() const { return &m_data; } Obj m_data; }; Obj* func(bool(*predicate)(const ObjPtr&) = {}) { return 0; } int main() { return func([](const auto& arg) { return arg->bmem; }); The call to "func" in main gets underlined as 'Invalid argument'. It only happens if the "func" argument type has overloaded operator-> and the result type of lambda is inferred from a "->" dereference of argument. If I use ObjPtr instead of auto, it works correctly: int main() { return func([](const ObjPtr& arg) { return arg->bmem; }); }