Lines Matching refs:FnDecl
11658 const FunctionDecl *FnDecl) { in CheckOperatorNewDeleteDeclarationScope() argument
11659 const DeclContext *DC = FnDecl->getDeclContext()->getRedeclContext(); in CheckOperatorNewDeleteDeclarationScope()
11661 return SemaRef.Diag(FnDecl->getLocation(), in CheckOperatorNewDeleteDeclarationScope()
11663 << FnDecl->getDeclName(); in CheckOperatorNewDeleteDeclarationScope()
11667 FnDecl->getStorageClass() == SC_Static) { in CheckOperatorNewDeleteDeclarationScope()
11668 return SemaRef.Diag(FnDecl->getLocation(), in CheckOperatorNewDeleteDeclarationScope()
11670 << FnDecl->getDeclName(); in CheckOperatorNewDeleteDeclarationScope()
11677 CheckOperatorNewDeleteTypes(Sema &SemaRef, const FunctionDecl *FnDecl, in CheckOperatorNewDeleteTypes() argument
11683 FnDecl->getType()->getAs<FunctionType>()->getReturnType(); in CheckOperatorNewDeleteTypes()
11687 return SemaRef.Diag(FnDecl->getLocation(), in CheckOperatorNewDeleteTypes()
11689 << FnDecl->getDeclName() << ExpectedResultType; in CheckOperatorNewDeleteTypes()
11693 return SemaRef.Diag(FnDecl->getLocation(), in CheckOperatorNewDeleteTypes()
11695 << FnDecl->getDeclName() << ExpectedResultType; in CheckOperatorNewDeleteTypes()
11698 if (FnDecl->getDescribedFunctionTemplate() && FnDecl->getNumParams() < 2) in CheckOperatorNewDeleteTypes()
11699 return SemaRef.Diag(FnDecl->getLocation(), in CheckOperatorNewDeleteTypes()
11701 << FnDecl->getDeclName(); in CheckOperatorNewDeleteTypes()
11704 if (FnDecl->getNumParams() == 0) in CheckOperatorNewDeleteTypes()
11705 return SemaRef.Diag(FnDecl->getLocation(), in CheckOperatorNewDeleteTypes()
11707 << FnDecl->getDeclName(); in CheckOperatorNewDeleteTypes()
11710 QualType FirstParamType = FnDecl->getParamDecl(0)->getType(); in CheckOperatorNewDeleteTypes()
11712 return SemaRef.Diag(FnDecl->getLocation(), DependentParamTypeDiag) in CheckOperatorNewDeleteTypes()
11713 << FnDecl->getDeclName() << ExpectedFirstParamType; in CheckOperatorNewDeleteTypes()
11718 return SemaRef.Diag(FnDecl->getLocation(), InvalidParamTypeDiag) in CheckOperatorNewDeleteTypes()
11719 << FnDecl->getDeclName() << ExpectedFirstParamType; in CheckOperatorNewDeleteTypes()
11725 CheckOperatorNewDeclaration(Sema &SemaRef, const FunctionDecl *FnDecl) { in CheckOperatorNewDeclaration() argument
11730 if (CheckOperatorNewDeleteDeclarationScope(SemaRef, FnDecl)) in CheckOperatorNewDeclaration()
11739 if (CheckOperatorNewDeleteTypes(SemaRef, FnDecl, SemaRef.Context.VoidPtrTy, in CheckOperatorNewDeclaration()
11747 if (FnDecl->getParamDecl(0)->hasDefaultArg()) in CheckOperatorNewDeclaration()
11748 return SemaRef.Diag(FnDecl->getLocation(), in CheckOperatorNewDeclaration()
11750 << FnDecl->getDeclName() << FnDecl->getParamDecl(0)->getDefaultArgRange(); in CheckOperatorNewDeclaration()
11756 CheckOperatorDeleteDeclaration(Sema &SemaRef, FunctionDecl *FnDecl) { in CheckOperatorDeleteDeclaration() argument
11761 if (CheckOperatorNewDeleteDeclarationScope(SemaRef, FnDecl)) in CheckOperatorDeleteDeclaration()
11767 if (CheckOperatorNewDeleteTypes(SemaRef, FnDecl, SemaRef.Context.VoidTy, in CheckOperatorDeleteDeclaration()
11779 bool Sema::CheckOverloadedOperatorDeclaration(FunctionDecl *FnDecl) { in CheckOverloadedOperatorDeclaration() argument
11780 assert(FnDecl && FnDecl->isOverloadedOperator() && in CheckOverloadedOperatorDeclaration()
11783 OverloadedOperatorKind Op = FnDecl->getOverloadedOperator(); in CheckOverloadedOperatorDeclaration()
11792 return CheckOperatorDeleteDeclaration(*this, FnDecl); in CheckOverloadedOperatorDeclaration()
11795 return CheckOperatorNewDeclaration(*this, FnDecl); in CheckOverloadedOperatorDeclaration()
11802 if (CXXMethodDecl *MethodDecl = dyn_cast<CXXMethodDecl>(FnDecl)) { in CheckOverloadedOperatorDeclaration()
11804 return Diag(FnDecl->getLocation(), in CheckOverloadedOperatorDeclaration()
11805 diag::err_operator_overload_static) << FnDecl->getDeclName(); in CheckOverloadedOperatorDeclaration()
11808 for (auto Param : FnDecl->parameters()) { in CheckOverloadedOperatorDeclaration()
11818 return Diag(FnDecl->getLocation(), in CheckOverloadedOperatorDeclaration()
11820 << FnDecl->getDeclName(); in CheckOverloadedOperatorDeclaration()
11830 for (auto Param : FnDecl->parameters()) { in CheckOverloadedOperatorDeclaration()
11834 << FnDecl->getDeclName() << Param->getDefaultArgRange(); in CheckOverloadedOperatorDeclaration()
11853 unsigned NumParams = FnDecl->getNumParams() in CheckOverloadedOperatorDeclaration()
11854 + (isa<CXXMethodDecl>(FnDecl)? 1 : 0); in CheckOverloadedOperatorDeclaration()
11871 return Diag(FnDecl->getLocation(), diag::err_operator_overload_must_be) in CheckOverloadedOperatorDeclaration()
11872 << FnDecl->getDeclName() << NumParams << ErrorKind; in CheckOverloadedOperatorDeclaration()
11877 FnDecl->getType()->getAs<FunctionProtoType>()->isVariadic()) { in CheckOverloadedOperatorDeclaration()
11878 return Diag(FnDecl->getLocation(), diag::err_operator_overload_variadic) in CheckOverloadedOperatorDeclaration()
11879 << FnDecl->getDeclName(); in CheckOverloadedOperatorDeclaration()
11883 if (MustBeMemberOperator && !isa<CXXMethodDecl>(FnDecl)) { in CheckOverloadedOperatorDeclaration()
11884 return Diag(FnDecl->getLocation(), in CheckOverloadedOperatorDeclaration()
11886 << FnDecl->getDeclName(); in CheckOverloadedOperatorDeclaration()
11900 ParmVarDecl *LastParam = FnDecl->getParamDecl(FnDecl->getNumParams() - 1); in CheckOverloadedOperatorDeclaration()
11959 bool Sema::CheckLiteralOperatorDeclaration(FunctionDecl *FnDecl) { in CheckLiteralOperatorDeclaration() argument
11960 if (isa<CXXMethodDecl>(FnDecl)) { in CheckLiteralOperatorDeclaration()
11961 Diag(FnDecl->getLocation(), diag::err_literal_operator_outside_namespace) in CheckLiteralOperatorDeclaration()
11962 << FnDecl->getDeclName(); in CheckLiteralOperatorDeclaration()
11966 if (FnDecl->isExternC()) { in CheckLiteralOperatorDeclaration()
11967 Diag(FnDecl->getLocation(), diag::err_literal_operator_extern_c); in CheckLiteralOperatorDeclaration()
11972 FunctionTemplateDecl *TpDecl = FnDecl->getDescribedFunctionTemplate(); in CheckLiteralOperatorDeclaration()
11976 TpDecl = FnDecl->getPrimaryTemplate(); in CheckLiteralOperatorDeclaration()
11982 if (FnDecl->param_size() != 0) { in CheckLiteralOperatorDeclaration()
11983 Diag(FnDecl->getLocation(), in CheckLiteralOperatorDeclaration()
11991 } else if (FnDecl->param_size() == 1) { in CheckLiteralOperatorDeclaration()
11992 const ParmVarDecl *Param = FnDecl->getParamDecl(0); in CheckLiteralOperatorDeclaration()
12034 } else if (FnDecl->param_size() == 2) { in CheckLiteralOperatorDeclaration()
12035 FunctionDecl::param_iterator Param = FnDecl->param_begin(); in CheckLiteralOperatorDeclaration()
12087 Diag(FnDecl->getLocation(), diag::err_literal_operator_bad_param_count); in CheckLiteralOperatorDeclaration()
12095 for (auto Param : FnDecl->parameters()) { in CheckLiteralOperatorDeclaration()
12105 = FnDecl->getDeclName().getCXXLiteralIdentifier()->getName(); in CheckLiteralOperatorDeclaration()
12110 Diag(FnDecl->getLocation(), diag::warn_user_literal_reserved) in CheckLiteralOperatorDeclaration()