Lines Matching refs:FnDecl
9241 const FunctionDecl *FnDecl) {
9242 const DeclContext *DC = FnDecl->getDeclContext()->getRedeclContext();
9244 return SemaRef.Diag(FnDecl->getLocation(),
9246 << FnDecl->getDeclName();
9250 FnDecl->getStorageClass() == SC_Static) {
9251 return SemaRef.Diag(FnDecl->getLocation(),
9253 << FnDecl->getDeclName();
9260 CheckOperatorNewDeleteTypes(Sema &SemaRef, const FunctionDecl *FnDecl,
9266 FnDecl->getType()->getAs<FunctionType>()->getResultType();
9270 return SemaRef.Diag(FnDecl->getLocation(),
9272 << FnDecl->getDeclName() << ExpectedResultType;
9276 return SemaRef.Diag(FnDecl->getLocation(),
9278 << FnDecl->getDeclName() << ExpectedResultType;
9281 if (FnDecl->getDescribedFunctionTemplate() && FnDecl->getNumParams() < 2)
9282 return SemaRef.Diag(FnDecl->getLocation(),
9284 << FnDecl->getDeclName();
9287 if (FnDecl->getNumParams() == 0)
9288 return SemaRef.Diag(FnDecl->getLocation(),
9290 << FnDecl->getDeclName();
9293 QualType FirstParamType = FnDecl->getParamDecl(0)->getType();
9295 return SemaRef.Diag(FnDecl->getLocation(), DependentParamTypeDiag)
9296 << FnDecl->getDeclName() << ExpectedFirstParamType;
9301 return SemaRef.Diag(FnDecl->getLocation(), InvalidParamTypeDiag)
9302 << FnDecl->getDeclName() << ExpectedFirstParamType;
9308 CheckOperatorNewDeclaration(Sema &SemaRef, const FunctionDecl *FnDecl) {
9313 if (CheckOperatorNewDeleteDeclarationScope(SemaRef, FnDecl))
9322 if (CheckOperatorNewDeleteTypes(SemaRef, FnDecl, SemaRef.Context.VoidPtrTy,
9330 if (FnDecl->getParamDecl(0)->hasDefaultArg())
9331 return SemaRef.Diag(FnDecl->getLocation(),
9333 << FnDecl->getDeclName() << FnDecl->getParamDecl(0)->getDefaultArgRange();
9339 CheckOperatorDeleteDeclaration(Sema &SemaRef, const FunctionDecl *FnDecl) {
9344 if (CheckOperatorNewDeleteDeclarationScope(SemaRef, FnDecl))
9350 if (CheckOperatorNewDeleteTypes(SemaRef, FnDecl, SemaRef.Context.VoidTy,
9362 bool Sema::CheckOverloadedOperatorDeclaration(FunctionDecl *FnDecl) {
9363 assert(FnDecl && FnDecl->isOverloadedOperator() &&
9366 OverloadedOperatorKind Op = FnDecl->getOverloadedOperator();
9375 return CheckOperatorDeleteDeclaration(*this, FnDecl);
9378 return CheckOperatorNewDeclaration(*this, FnDecl);
9385 if (CXXMethodDecl *MethodDecl = dyn_cast<CXXMethodDecl>(FnDecl)) {
9387 return Diag(FnDecl->getLocation(),
9388 diag::err_operator_overload_static) << FnDecl->getDeclName();
9391 for (FunctionDecl::param_iterator Param = FnDecl->param_begin(),
9392 ParamEnd = FnDecl->param_end();
9403 return Diag(FnDecl->getLocation(),
9405 << FnDecl->getDeclName();
9415 for (FunctionDecl::param_iterator Param = FnDecl->param_begin();
9416 Param != FnDecl->param_end(); ++Param) {
9420 << FnDecl->getDeclName() << (*Param)->getDefaultArgRange();
9439 unsigned NumParams = FnDecl->getNumParams()
9440 + (isa<CXXMethodDecl>(FnDecl)? 1 : 0);
9457 return Diag(FnDecl->getLocation(), diag::err_operator_overload_must_be)
9458 << FnDecl->getDeclName() << NumParams << ErrorKind;
9463 FnDecl->getType()->getAs<FunctionProtoType>()->isVariadic()) {
9464 return Diag(FnDecl->getLocation(), diag::err_operator_overload_variadic)
9465 << FnDecl->getDeclName();
9469 if (MustBeMemberOperator && !isa<CXXMethodDecl>(FnDecl)) {
9470 return Diag(FnDecl->getLocation(),
9472 << FnDecl->getDeclName();
9486 ParmVarDecl *LastParam = FnDecl->getParamDecl(FnDecl->getNumParams() - 1);
9503 bool Sema::CheckLiteralOperatorDeclaration(FunctionDecl *FnDecl) {
9504 if (isa<CXXMethodDecl>(FnDecl)) {
9505 Diag(FnDecl->getLocation(), diag::err_literal_operator_outside_namespace)
9506 << FnDecl->getDeclName();
9510 if (FnDecl->isExternC()) {
9511 Diag(FnDecl->getLocation(), diag::err_literal_operator_extern_c);
9518 FunctionTemplateDecl *TpDecl = FnDecl->getDescribedFunctionTemplate();
9521 TpDecl = FnDecl->getPrimaryTemplate();
9526 if (FnDecl->param_size() == 0) {
9539 } else if (FnDecl->param_size()) {
9541 FunctionDecl::param_iterator Param = FnDecl->param_begin();
9553 if (++Param == FnDecl->param_end())
9571 if (Param == FnDecl->param_end()) {
9588 ++Param == FnDecl->param_end())
9595 Diag(FnDecl->getLocation(), diag::err_literal_operator_params)
9596 << FnDecl->getDeclName();
9602 for (FunctionDecl::param_iterator Param = FnDecl->param_begin(),
9603 ParamEnd = FnDecl->param_end();
9614 = FnDecl->getDeclName().getCXXLiteralIdentifier()->getName();
9619 Diag(FnDecl->getLocation(), diag::warn_user_literal_reserved);