main.cpp2:6:91: error: variable 'require' cannot be implicitly captured in a lambda with no capture-default specified
6 | require_fn require {[_0 = (&t)](auto const& ...args) mutable -> auto { return CPP2_UFCS(require, (*cpp2::assert_not_null(_0)), args...); }};
| ^
main.cpp2:6:14: note: 'require' declared here
6 | require_fn require {[_0 = (&t)](auto const& ...args) mutable -> auto { return CPP2_UFCS(require, (*cpp2::assert_not_null(_0)), args...); }};
| ^
require has type require_fn, so it isn't that its type is deduced.
But it still tries to use require without capturing it.
Name lookup finds an object, so it doesn't try a free function, and the object must be captured.
If we're in a context that would need to capture the name, we should not use the UFCS macro.
In the context of a member function, this would happen to work due to #281.
See thread starting at https://github.com/hsutter/cppfront/issues/550#issuecomment-1834594548: