/// \brief Add a lambda's conversion to function pointer, as described in
/// C++11 [expr.prim.lambda]p6.
-static void addFunctionPointerConversion(Sema &S,
+static void addFunctionPointerConversion(Sema &S,
SourceRange IntroducerRange,
CXXRecordDecl *Class,
CXXMethodDecl *CallOperator) {
// This conversion is explicitly disabled if the lambda's function has
// pass_object_size attributes on any of its parameters.
- if (llvm::any_of(CallOperator->parameters(),
- std::mem_fn(&ParmVarDecl::hasAttr<PassObjectSizeAttr>)))
+ auto HasPassObjectSizeAttr = [](const ParmVarDecl *P) {
+ return P->hasAttr<PassObjectSizeAttr>();
+ };
+ if (llvm::any_of(CallOperator->parameters(), HasPassObjectSizeAttr))
return;
// Add the conversion to function pointer.
using namespace sema;
static bool functionHasPassObjectSizeParams(const FunctionDecl *FD) {
- return llvm::any_of(FD->parameters(),
- std::mem_fn(&ParmVarDecl::hasAttr<PassObjectSizeAttr>));
+ return llvm::any_of(FD->parameters(), [](const ParmVarDecl *P) {
+ return P->hasAttr<PassObjectSizeAttr>();
+ });
}
/// A convenience routine for creating a decayed reference to a function.
return false;
}
- auto I = llvm::find_if(
- FD->parameters(), std::mem_fn(&ParmVarDecl::hasAttr<PassObjectSizeAttr>));
+ auto I = llvm::find_if(FD->parameters(), [](const ParmVarDecl *P) {
+ return P->hasAttr<PassObjectSizeAttr>();
+ });
if (I == FD->param_end())
return true;