================ @@ -2224,6 +2224,99 @@ static bool BuiltinCountZeroBitsGeneric(Sema &S, CallExpr *TheCall) { return false; } +static ExprResult BuiltinInvoke(Sema &S, CallExpr *TheCall) { + SourceLocation Loc = TheCall->getBeginLoc(); + MutableArrayRef Args(TheCall->getArgs(), TheCall->getNumArgs()); + assert(llvm::none_of(Args, [](Expr *Arg) { return Arg->isTypeDependent(); })); + + if (Args.size() == 0) { + S.Diag(TheCall->getBeginLoc(), + diag::err_typecheck_call_too_few_args_at_least) + << /*callee_type=*/0 << /*min_arg_count=*/1 << /*actual_arg_count=*/0 + << /*is_non_object=*/0 << TheCall->getSourceRange(); + return ExprError(); + } + + QualType FuncT = Args[0]->getType(); + + if (const auto *MPT = FuncT->getAs<MemberPointerType>()) { + if (Args.size() < 2) { ---------------- AaronBallman wrote:
We should have a test case for a member pointer to a function with an explicit object parameter. I believe this logic all still works, but the coverage would be good to have. https://github.com/llvm/llvm-project/pull/116709 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits