Lines Matching refs:FnDecl

16105                                        const FunctionDecl *FnDecl) {
16106 const DeclContext *DC = FnDecl->getDeclContext()->getRedeclContext();
16108 return SemaRef.Diag(FnDecl->getLocation(),
16110 << FnDecl->getDeclName();
16114 FnDecl->getStorageClass() == SC_Static) {
16115 return SemaRef.Diag(FnDecl->getLocation(),
16117 << FnDecl->getDeclName();
16133 CheckOperatorNewDeleteTypes(Sema &SemaRef, const FunctionDecl *FnDecl,
16139 FnDecl->getType()->castAs<FunctionType>()->getReturnType();
16156 FnDecl->getLocation(),
16160 << FnDecl->getDeclName() << ExpectedResultType;
16164 if (FnDecl->getDescribedFunctionTemplate() && FnDecl->getNumParams() < 2)
16165 return SemaRef.Diag(FnDecl->getLocation(),
16167 << FnDecl->getDeclName();
16170 if (FnDecl->getNumParams() == 0)
16171 return SemaRef.Diag(FnDecl->getLocation(),
16173 << FnDecl->getDeclName();
16175 QualType FirstParamType = FnDecl->getParamDecl(0)->getType();
16180 FnDecl->getParamDecl(0)->getType()->getAs<PointerType>())
16194 return SemaRef.Diag(FnDecl->getLocation(), FirstParamType->isDependentType()
16197 << FnDecl->getDeclName() << ExpectedFirstParamType;
16204 CheckOperatorNewDeclaration(Sema &SemaRef, const FunctionDecl *FnDecl) {
16209 if (CheckOperatorNewDeleteDeclarationScope(SemaRef, FnDecl))
16218 if (CheckOperatorNewDeleteTypes(SemaRef, FnDecl, SemaRef.Context.VoidPtrTy,
16226 if (FnDecl->getParamDecl(0)->hasDefaultArg())
16227 return SemaRef.Diag(FnDecl->getLocation(),
16229 << FnDecl->getDeclName() << FnDecl->getParamDecl(0)->getDefaultArgRange();
16235 CheckOperatorDeleteDeclaration(Sema &SemaRef, FunctionDecl *FnDecl) {
16240 if (CheckOperatorNewDeleteDeclarationScope(SemaRef, FnDecl))
16243 auto *MD = dyn_cast<CXXMethodDecl>(FnDecl);
16258 SemaRef, FnDecl, SemaRef.Context.VoidTy, ExpectedFirstParamType,
16276 bool Sema::CheckOverloadedOperatorDeclaration(FunctionDecl *FnDecl) {
16277 assert(FnDecl && FnDecl->isOverloadedOperator() &&
16280 OverloadedOperatorKind Op = FnDecl->getOverloadedOperator();
16289 return CheckOperatorDeleteDeclaration(*this, FnDecl);
16292 return CheckOperatorNewDeclaration(*this, FnDecl);
16301 if (CXXMethodDecl *MethodDecl = dyn_cast<CXXMethodDecl>(FnDecl)) {
16304 Diag(FnDecl->getLocation(),
16308 << FnDecl;
16310 return Diag(FnDecl->getLocation(), diag::err_operator_overload_static)
16311 << FnDecl;
16315 for (auto *Param : FnDecl->parameters()) {
16325 return Diag(FnDecl->getLocation(),
16327 << FnDecl->getDeclName();
16338 for (auto *Param : FnDecl->parameters()) {
16346 Diag(FnDecl->getLocation(), LangOpts.CPlusPlus23
16349 << FnDecl->getDeclName() << 1
16354 << FnDecl->getDeclName()
16375 unsigned NumParams = FnDecl->getNumParams() +
16376 (isa<CXXMethodDecl>(FnDecl) &&
16377 !FnDecl->hasCXXExplicitFunctionObjectParameter()
16395 return Diag(FnDecl->getLocation(), diag::err_operator_overload_must_be)
16396 << FnDecl->getDeclName() << NumParams << ErrorKind;
16400 Diag(FnDecl->getLocation(), LangOpts.CPlusPlus23
16403 << FnDecl->getDeclName() << (NumParams == 1 ? 0 : 2);
16409 FnDecl->getType()->castAs<FunctionProtoType>()->isVariadic()) {
16410 return Diag(FnDecl->getLocation(), diag::err_operator_overload_variadic)
16411 << FnDecl->getDeclName();
16415 if (MustBeMemberOperator && !isa<CXXMethodDecl>(FnDecl)) {
16416 return Diag(FnDecl->getLocation(),
16418 << FnDecl->getDeclName();
16432 ParmVarDecl *LastParam = FnDecl->getParamDecl(FnDecl->getNumParams() - 1);
16500 bool Sema::CheckLiteralOperatorDeclaration(FunctionDecl *FnDecl) {
16501 if (isa<CXXMethodDecl>(FnDecl)) {
16502 Diag(FnDecl->getLocation(), diag::err_literal_operator_outside_namespace)
16503 << FnDecl->getDeclName();
16507 if (FnDecl->isExternC()) {
16508 Diag(FnDecl->getLocation(), diag::err_literal_operator_extern_c);
16510 FnDecl->getDeclContext()->getExternCContext())
16516 FunctionTemplateDecl *TpDecl = FnDecl->getDescribedFunctionTemplate();
16520 TpDecl = FnDecl->getPrimaryTemplate();
16528 if (FnDecl->param_size() != 0) {
16529 Diag(FnDecl->getLocation(),
16537 } else if (FnDecl->param_size() == 1) {
16538 const ParmVarDecl *Param = FnDecl->getParamDecl(0);
16581 } else if (FnDecl->param_size() == 2) {
16582 FunctionDecl::param_iterator Param = FnDecl->param_begin();
16636 Diag(FnDecl->getLocation(), diag::err_literal_operator_bad_param_count);
16644 for (auto *Param : FnDecl->parameters()) {
16653 const IdentifierInfo *II = FnDecl->getDeclName().getCXXLiteralIdentifier();
16656 !getSourceManager().isInSystemHeader(FnDecl->getLocation())) {
16662 Diag(FnDecl->getLocation(), diag::warn_user_literal_reserved)