Lines Matching defs:FnDecl

16203                                        const FunctionDecl *FnDecl) {
16204 const DeclContext *DC = FnDecl->getDeclContext()->getRedeclContext();
16206 return SemaRef.Diag(FnDecl->getLocation(),
16208 << FnDecl->getDeclName();
16212 FnDecl->getStorageClass() == SC_Static) {
16213 return SemaRef.Diag(FnDecl->getLocation(),
16215 << FnDecl->getDeclName();
16231 CheckOperatorNewDeleteTypes(Sema &SemaRef, const FunctionDecl *FnDecl,
16237 FnDecl->getType()->castAs<FunctionType>()->getReturnType();
16254 FnDecl->getLocation(),
16258 << FnDecl->getDeclName() << ExpectedResultType;
16262 if (FnDecl->getDescribedFunctionTemplate() && FnDecl->getNumParams() < 2)
16263 return SemaRef.Diag(FnDecl->getLocation(),
16265 << FnDecl->getDeclName();
16268 if (FnDecl->getNumParams() == 0)
16269 return SemaRef.Diag(FnDecl->getLocation(),
16271 << FnDecl->getDeclName();
16273 QualType FirstParamType = FnDecl->getParamDecl(0)->getType();
16278 FnDecl->getParamDecl(0)->getType()->getAs<PointerType>())
16292 return SemaRef.Diag(FnDecl->getLocation(), FirstParamType->isDependentType()
16295 << FnDecl->getDeclName() << ExpectedFirstParamType;
16302 CheckOperatorNewDeclaration(Sema &SemaRef, const FunctionDecl *FnDecl) {
16307 if (CheckOperatorNewDeleteDeclarationScope(SemaRef, FnDecl))
16316 if (CheckOperatorNewDeleteTypes(SemaRef, FnDecl, SemaRef.Context.VoidPtrTy,
16324 if (FnDecl->getParamDecl(0)->hasDefaultArg())
16325 return SemaRef.Diag(FnDecl->getLocation(),
16327 << FnDecl->getDeclName() << FnDecl->getParamDecl(0)->getDefaultArgRange();
16333 CheckOperatorDeleteDeclaration(Sema &SemaRef, FunctionDecl *FnDecl) {
16338 if (CheckOperatorNewDeleteDeclarationScope(SemaRef, FnDecl))
16341 auto *MD = dyn_cast<CXXMethodDecl>(FnDecl);
16356 SemaRef, FnDecl, SemaRef.Context.VoidTy, ExpectedFirstParamType,
16374 bool Sema::CheckOverloadedOperatorDeclaration(FunctionDecl *FnDecl) {
16375 assert(FnDecl && FnDecl->isOverloadedOperator() &&
16378 OverloadedOperatorKind Op = FnDecl->getOverloadedOperator();
16387 return CheckOperatorDeleteDeclaration(*this, FnDecl);
16390 return CheckOperatorNewDeclaration(*this, FnDecl);
16399 if (CXXMethodDecl *MethodDecl = dyn_cast<CXXMethodDecl>(FnDecl)) {
16402 Diag(FnDecl->getLocation(),
16406 << FnDecl;
16408 return Diag(FnDecl->getLocation(), diag::err_operator_overload_static)
16409 << FnDecl;
16413 for (auto *Param : FnDecl->parameters()) {
16423 return Diag(FnDecl->getLocation(),
16425 << FnDecl->getDeclName();
16436 for (auto *Param : FnDecl->parameters()) {
16444 Diag(FnDecl->getLocation(), LangOpts.CPlusPlus23
16447 << FnDecl->getDeclName() << 1
16452 << FnDecl->getDeclName()
16473 unsigned NumParams = FnDecl->getNumParams() +
16474 (isa<CXXMethodDecl>(FnDecl) &&
16475 !FnDecl->hasCXXExplicitFunctionObjectParameter()
16493 return Diag(FnDecl->getLocation(), diag::err_operator_overload_must_be)
16494 << FnDecl->getDeclName() << NumParams << ErrorKind;
16498 Diag(FnDecl->getLocation(), LangOpts.CPlusPlus23
16501 << FnDecl->getDeclName() << (NumParams == 1 ? 0 : 2);
16507 FnDecl->getType()->castAs<FunctionProtoType>()->isVariadic()) {
16508 return Diag(FnDecl->getLocation(), diag::err_operator_overload_variadic)
16509 << FnDecl->getDeclName();
16513 if (MustBeMemberOperator && !isa<CXXMethodDecl>(FnDecl)) {
16514 return Diag(FnDecl->getLocation(),
16516 << FnDecl->getDeclName();
16530 ParmVarDecl *LastParam = FnDecl->getParamDecl(FnDecl->getNumParams() - 1);
16598 bool Sema::CheckLiteralOperatorDeclaration(FunctionDecl *FnDecl) {
16599 if (isa<CXXMethodDecl>(FnDecl)) {
16600 Diag(FnDecl->getLocation(), diag::err_literal_operator_outside_namespace)
16601 << FnDecl->getDeclName();
16605 if (FnDecl->isExternC()) {
16606 Diag(FnDecl->getLocation(), diag::err_literal_operator_extern_c);
16608 FnDecl->getDeclContext()->getExternCContext())
16614 FunctionTemplateDecl *TpDecl = FnDecl->getDescribedFunctionTemplate();
16618 TpDecl = FnDecl->getPrimaryTemplate();
16626 if (FnDecl->param_size() != 0) {
16627 Diag(FnDecl->getLocation(),
16635 } else if (FnDecl->param_size() == 1) {
16636 const ParmVarDecl *Param = FnDecl->getParamDecl(0);
16679 } else if (FnDecl->param_size() == 2) {
16680 FunctionDecl::param_iterator Param = FnDecl->param_begin();
16734 Diag(FnDecl->getLocation(), diag::err_literal_operator_bad_param_count);
16742 for (auto *Param : FnDecl->parameters()) {
16751 const IdentifierInfo *II = FnDecl->getDeclName().getCXXLiteralIdentifier();
16754 !getSourceManager().isInSystemHeader(FnDecl->getLocation())) {
16760 Diag(FnDecl->getLocation(), diag::warn_user_literal_reserved)