Lines Matching refs:NewFD
8234 Sema &SemaRef, LookupResult &Previous, FunctionDecl *NewFD, in DiagnoseInvalidRedeclaration() argument
8236 DeclarationName Name = NewFD->getDeclName(); in DiagnoseInvalidRedeclaration()
8237 DeclContext *NewDC = NewFD->getDeclContext(); in DiagnoseInvalidRedeclaration()
8244 NewFD->getFriendObjectKind() ? diag::err_qualified_friend_no_match : in DiagnoseInvalidRedeclaration()
8246 LookupResult Prev(SemaRef, Name, NewFD->getLocation(), in DiagnoseInvalidRedeclaration()
8251 NewFD->setInvalidDecl(); in DiagnoseInvalidRedeclaration()
8258 CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(NewFD); in DiagnoseInvalidRedeclaration()
8259 DifferentNameValidatorCCC CCC(SemaRef.Context, NewFD, in DiagnoseInvalidRedeclaration()
8266 hasSimilarParameters(SemaRef.Context, FD, NewFD, MismatchedParams)) { in DiagnoseInvalidRedeclaration()
8289 hasSimilarParameters(SemaRef.Context, FD, NewFD, MismatchedParams)) { in DiagnoseInvalidRedeclaration()
8308 NewFD->getTypeSourceInfo(), Previous, ExtraArgs.TemplateParamLists, in DiagnoseInvalidRedeclaration()
8342 SemaRef.Diag(NewFD->getLocation(), DiagMsg) in DiagnoseInvalidRedeclaration()
8343 << Name << NewDC << IsDefinition << NewFD->getLocation(); in DiagnoseInvalidRedeclaration()
8346 if (CXXMethodDecl *NewMD = dyn_cast<CXXMethodDecl>(NewFD)) in DiagnoseInvalidRedeclaration()
8365 << NewFD->getParamDecl(Idx - 1)->getType(); in DiagnoseInvalidRedeclaration()
8421 FunctionDecl *NewFD = nullptr; in CreateNewFunctionDecl() local
8435 NewFD = FunctionDecl::Create(SemaRef.Context, DC, D.getBeginLoc(), NameInfo, in CreateNewFunctionDecl()
8440 NewFD->setInvalidDecl(); in CreateNewFunctionDecl()
8442 return NewFD; in CreateNewFunctionDecl()
8907 FunctionDecl *NewFD = CreateNewFunctionDecl(*this, D, DC, R, TInfo, SC, in ActOnFunctionDeclarator() local
8909 if (!NewFD) return nullptr; in ActOnFunctionDeclarator()
8912 NewFD->setTopLevelDeclInObjCContainer(); in ActOnFunctionDeclarator()
8917 NewFD->setLexicalDeclContext(CurContext); in ActOnFunctionDeclarator()
8920 NewFD->setLocalExternDecl(); in ActOnFunctionDeclarator()
8931 NewFD->setImplicitlyInline(); in ActOnFunctionDeclarator()
8938 dyn_cast<CXXRecordDecl>(NewFD->getDeclContext())) { in ActOnFunctionDeclarator()
8939 if (Parent->isInterface() && cast<CXXMethodDecl>(NewFD)->isUserProvided()) in ActOnFunctionDeclarator()
8940 NewFD->setPure(true); in ActOnFunctionDeclarator()
8948 SetNestedNameSpecifier(*this, NewFD, D); in ActOnFunctionDeclarator()
8952 NewFD->setInvalidDecl(); in ActOnFunctionDeclarator()
8969 NewFD->setInvalidDecl(); in ActOnFunctionDeclarator()
8976 Diag(NewFD->getLocation(), diag::err_destructor_template); in ActOnFunctionDeclarator()
8977 NewFD->setInvalidDecl(); in ActOnFunctionDeclarator()
8990 NewFD->getLocation(), in ActOnFunctionDeclarator()
8992 NewFD); in ActOnFunctionDeclarator()
8994 NewFD->setDescribedFunctionTemplate(FunctionTemplate); in ActOnFunctionDeclarator()
8998 NewFD->setTemplateParameterListsInfo(Context, in ActOnFunctionDeclarator()
9007 NewFD->setTemplateParameterListsInfo(Context, TemplateParamLists); in ActOnFunctionDeclarator()
9035 NewFD->setInvalidDecl(); in ActOnFunctionDeclarator()
9041 NewFD->setTemplateParameterListsInfo(Context, TemplateParamLists); in ActOnFunctionDeclarator()
9045 NewFD->setInvalidDecl(); in ActOnFunctionDeclarator()
9055 if (isVirtual && !NewFD->isInvalidDecl()) { in ActOnFunctionDeclarator()
9064 } else if (NewFD->getDescribedFunctionTemplate()) { in ActOnFunctionDeclarator()
9072 NewFD->setVirtualAsWritten(true); in ActOnFunctionDeclarator()
9076 NewFD->getReturnType()->isUndeducedType()) in ActOnFunctionDeclarator()
9081 (NewFD->isDependentContext() || in ActOnFunctionDeclarator()
9083 NewFD->getReturnType()->isUndeducedType()) { in ActOnFunctionDeclarator()
9091 NewFD->getType()->castAs<FunctionProtoType>(); in ActOnFunctionDeclarator()
9094 NewFD->setType(Context.getFunctionType(Result, FPT->getParamTypes(), in ActOnFunctionDeclarator()
9101 if (isInline && !NewFD->isInvalidDecl()) { in ActOnFunctionDeclarator()
9114 if (hasExplicit && !NewFD->isInvalidDecl() && in ActOnFunctionDeclarator()
9115 !isa<CXXDeductionGuideDecl>(NewFD)) { in ActOnFunctionDeclarator()
9121 } else if (!isa<CXXConstructorDecl>(NewFD) && in ActOnFunctionDeclarator()
9122 !isa<CXXConversionDecl>(NewFD)) { in ActOnFunctionDeclarator()
9135 NewFD->setImplicitlyInline(); in ActOnFunctionDeclarator()
9140 if (isa<CXXDestructorDecl>(NewFD) && in ActOnFunctionDeclarator()
9145 NewFD->setConstexprKind(getLangOpts().CPlusPlus20 in ActOnFunctionDeclarator()
9153 (NewFD->getOverloadedOperator() == OO_New || in ActOnFunctionDeclarator()
9154 NewFD->getOverloadedOperator() == OO_Array_New || in ActOnFunctionDeclarator()
9155 NewFD->getOverloadedOperator() == OO_Delete || in ActOnFunctionDeclarator()
9156 NewFD->getOverloadedOperator() == OO_Array_Delete)) { in ActOnFunctionDeclarator()
9159 << NewFD; in ActOnFunctionDeclarator()
9160 NewFD->setConstexprKind(ConstexprSpecKind::Constexpr); in ActOnFunctionDeclarator()
9173 NewFD->setModulePrivate(); in ActOnFunctionDeclarator()
9184 NewFD->setObjectOfFriendDecl(); in ActOnFunctionDeclarator()
9185 NewFD->setAccess(AS_public); in ActOnFunctionDeclarator()
9196 NewFD->setDefaulted(); in ActOnFunctionDeclarator()
9200 NewFD->setDeletedAsWritten(); in ActOnFunctionDeclarator()
9204 if (isa<CXXMethodDecl>(NewFD) && DC == CurContext && in ActOnFunctionDeclarator()
9209 NewFD->setImplicitlyInline(); in ActOnFunctionDeclarator()
9212 if (SC == SC_Static && isa<CXXMethodDecl>(NewFD) && in ActOnFunctionDeclarator()
9228 (getLangOpts().MSVCCompat && NewFD->getDescribedFunctionTemplate())) in ActOnFunctionDeclarator()
9240 NewFD->setType(Context.getFunctionType( in ActOnFunctionDeclarator()
9246 FilterLookupForScope(Previous, OriginalDC, S, shouldConsiderLinkage(NewFD), in ActOnFunctionDeclarator()
9255 NewFD->addAttr(AsmLabelAttr::Create(Context, SE->getString(), in ActOnFunctionDeclarator()
9260 ExtnameUndeclaredIdentifiers.find(NewFD->getIdentifier()); in ActOnFunctionDeclarator()
9262 if (isDeclExternC(NewFD)) { in ActOnFunctionDeclarator()
9263 NewFD->addAttr(I->second); in ActOnFunctionDeclarator()
9266 Diag(NewFD->getLocation(), diag::warn_redefine_extname_not_applied) in ActOnFunctionDeclarator()
9267 << /*Variable*/0 << NewFD; in ActOnFunctionDeclarator()
9286 assert(Param->getDeclContext() != NewFD && "Was set before ?"); in ActOnFunctionDeclarator()
9287 Param->setDeclContext(NewFD); in ActOnFunctionDeclarator()
9291 NewFD->setInvalidDecl(); in ActOnFunctionDeclarator()
9301 getTagInjectionContext(NewFD->getLexicalDeclContext()); in ActOnFunctionDeclarator()
9317 TD->setDeclContext(NewFD); in ActOnFunctionDeclarator()
9318 NewFD->addDecl(TD); in ActOnFunctionDeclarator()
9342 BuildParmVarDeclForTypedef(NewFD, D.getIdentifierLoc(), AI); in ActOnFunctionDeclarator()
9347 assert(R->isFunctionNoProtoType() && NewFD->getNumParams() == 0 && in ActOnFunctionDeclarator()
9352 NewFD->setParams(Params); in ActOnFunctionDeclarator()
9355 NewFD->addAttr(C11NoReturnAttr::Create(Context, in ActOnFunctionDeclarator()
9361 if (!NewFD->isInvalidDecl() && in ActOnFunctionDeclarator()
9362 NewFD->getReturnType()->isVariablyModifiedType()) { in ActOnFunctionDeclarator()
9363 Diag(NewFD->getLocation(), diag::err_vm_func_decl); in ActOnFunctionDeclarator()
9364 NewFD->setInvalidDecl(); in ActOnFunctionDeclarator()
9369 !NewFD->hasAttr<SectionAttr>()) in ActOnFunctionDeclarator()
9370 NewFD->addAttr(PragmaClangTextSectionAttr::CreateImplicit( in ActOnFunctionDeclarator()
9376 !NewFD->hasAttr<SectionAttr>()) { in ActOnFunctionDeclarator()
9377 NewFD->addAttr(SectionAttr::CreateImplicit( in ActOnFunctionDeclarator()
9384 NewFD)) in ActOnFunctionDeclarator()
9385 NewFD->dropAttr<SectionAttr>(); in ActOnFunctionDeclarator()
9390 if (!NewFD->hasAttr<CodeSegAttr>()) { in ActOnFunctionDeclarator()
9391 if (Attr *SAttr = getImplicitCodeSegOrSectionAttrForFunction(NewFD, in ActOnFunctionDeclarator()
9393 NewFD->addAttr(SAttr); in ActOnFunctionDeclarator()
9398 ProcessDeclAttributes(S, NewFD, D); in ActOnFunctionDeclarator()
9403 LangAS AddressSpace = NewFD->getReturnType().getAddressSpace(); in ActOnFunctionDeclarator()
9405 Diag(NewFD->getLocation(), in ActOnFunctionDeclarator()
9407 NewFD->setInvalidDecl(); in ActOnFunctionDeclarator()
9413 if (!NewFD->isInvalidDecl() && NewFD->isMain()) in ActOnFunctionDeclarator()
9414 CheckMain(NewFD, D.getDeclSpec()); in ActOnFunctionDeclarator()
9416 if (!NewFD->isInvalidDecl() && NewFD->isMSVCRTEntryPoint()) in ActOnFunctionDeclarator()
9417 CheckMSVCRTEntryPoint(NewFD); in ActOnFunctionDeclarator()
9419 if (!NewFD->isInvalidDecl()) in ActOnFunctionDeclarator()
9420 D.setRedeclaration(CheckFunctionDeclaration(S, NewFD, Previous, in ActOnFunctionDeclarator()
9425 assert((NewFD->isInvalidDecl() || !D.isRedeclaration() || in ActOnFunctionDeclarator()
9432 const FunctionType *FT = NewFD->getType()->castAs<FunctionType>(); in ActOnFunctionDeclarator()
9440 Diag(NewFD->getLocation(), DiagID) in ActOnFunctionDeclarator()
9445 if (NewFD->getReturnType().hasNonTrivialToPrimitiveDestructCUnion() || in ActOnFunctionDeclarator()
9446 NewFD->getReturnType().hasNonTrivialToPrimitiveCopyCUnion()) in ActOnFunctionDeclarator()
9447 checkNonTrivialCUnion(NewFD->getReturnType(), in ActOnFunctionDeclarator()
9448 NewFD->getReturnTypeSourceRange().getBegin(), in ActOnFunctionDeclarator()
9459 NewFD->isReplaceableGlobalAllocationFunction() && in ActOnFunctionDeclarator()
9460 !NewFD->hasAttr<UsedAttr>()) in ActOnFunctionDeclarator()
9463 << NewFD->getDeclName(); in ActOnFunctionDeclarator()
9478 if (NewFD->isInvalidDecl()) { in ActOnFunctionDeclarator()
9512 maybeAddCUDAHostDeviceAttrs(NewFD, Previous); in ActOnFunctionDeclarator()
9520 (NewFD->getType()->isDependentType() || DC->isDependentContext() || in ActOnFunctionDeclarator()
9526 if (CheckDependentFunctionTemplateSpecialization(NewFD, TemplateArgs, in ActOnFunctionDeclarator()
9528 NewFD->setInvalidDecl(); in ActOnFunctionDeclarator()
9533 } else if (!NewFD->isInvalidDecl() && in ActOnFunctionDeclarator()
9535 NewFD, (HasExplicitTemplateArgs ? &TemplateArgs : nullptr), in ActOnFunctionDeclarator()
9537 NewFD->setInvalidDecl(); in ActOnFunctionDeclarator()
9543 NewFD->getTemplateSpecializationInfo(); in ActOnFunctionDeclarator()
9546 Diag(NewFD->getLocation(), in ActOnFunctionDeclarator()
9553 Diag(NewFD->getLocation(), in ActOnFunctionDeclarator()
9558 } else if (isMemberSpecialization && isa<CXXMethodDecl>(NewFD)) { in ActOnFunctionDeclarator()
9559 if (CheckMemberSpecialization(NewFD, Previous)) in ActOnFunctionDeclarator()
9560 NewFD->setInvalidDecl(); in ActOnFunctionDeclarator()
9565 if (!NewFD->isInvalidDecl() && NewFD->isMain()) in ActOnFunctionDeclarator()
9566 CheckMain(NewFD, D.getDeclSpec()); in ActOnFunctionDeclarator()
9568 if (!NewFD->isInvalidDecl() && NewFD->isMSVCRTEntryPoint()) in ActOnFunctionDeclarator()
9569 CheckMSVCRTEntryPoint(NewFD); in ActOnFunctionDeclarator()
9571 if (!NewFD->isInvalidDecl()) in ActOnFunctionDeclarator()
9572 D.setRedeclaration(CheckFunctionDeclaration(S, NewFD, Previous, in ActOnFunctionDeclarator()
9579 assert((NewFD->isInvalidDecl() || !D.isRedeclaration() || in ActOnFunctionDeclarator()
9585 : NewFD); in ActOnFunctionDeclarator()
9587 if (isFriend && NewFD->getPreviousDecl()) { in ActOnFunctionDeclarator()
9589 if (!NewFD->isInvalidDecl()) in ActOnFunctionDeclarator()
9590 Access = NewFD->getPreviousDecl()->getAccess(); in ActOnFunctionDeclarator()
9592 NewFD->setAccess(Access); in ActOnFunctionDeclarator()
9596 if (NewFD->isOverloadedOperator() && !DC->isRecord() && in ActOnFunctionDeclarator()
9619 if (NewFD->isInvalidDecl()) { in ActOnFunctionDeclarator()
9625 if (isa<CXXRecordDecl>(NewFD->getDeclContext())) in ActOnFunctionDeclarator()
9626 NewFD->setAccess(AS_public); in ActOnFunctionDeclarator()
9664 *this, Previous, NewFD, ExtraArgs, false, nullptr)) { in ActOnFunctionDeclarator()
9674 *this, Previous, NewFD, ExtraArgs, true, S)) { in ActOnFunctionDeclarator()
9680 isa<CXXMethodDecl>(NewFD) && NewFD->isOutOfLine() && in ActOnFunctionDeclarator()
9690 Diag(NewFD->getLocation(), diag::ext_out_of_line_declaration) in ActOnFunctionDeclarator()
9698 NewFD->getDeclContext()->getRedeclContext()->isFileContext()) { in ActOnFunctionDeclarator()
9701 if (NewFD->getLanguageLinkage() == CLanguageLinkage) { in ActOnFunctionDeclarator()
9705 NewFD->addAttr(BuiltinAttr::CreateImplicit(Context, BuiltinID)); in ActOnFunctionDeclarator()
9713 NewFD->getType(), BuiltinType)) in ActOnFunctionDeclarator()
9714 NewFD->addAttr(BuiltinAttr::CreateImplicit(Context, BuiltinID)); in ActOnFunctionDeclarator()
9719 NewFD->addAttr(BuiltinAttr::CreateImplicit(Context, BuiltinID)); in ActOnFunctionDeclarator()
9725 ProcessPragmaWeak(S, NewFD); in ActOnFunctionDeclarator()
9726 checkAttributesAfterMerging(*this, *NewFD); in ActOnFunctionDeclarator()
9728 AddKnownFunctionAttributes(NewFD); in ActOnFunctionDeclarator()
9730 if (NewFD->hasAttr<OverloadableAttr>() && in ActOnFunctionDeclarator()
9731 !NewFD->getType()->getAs<FunctionProtoType>()) { in ActOnFunctionDeclarator()
9732 Diag(NewFD->getLocation(), in ActOnFunctionDeclarator()
9734 << NewFD; in ActOnFunctionDeclarator()
9737 const FunctionType *FT = NewFD->getType()->getAs<FunctionType>(); in ActOnFunctionDeclarator()
9744 NewFD->setType(R); in ActOnFunctionDeclarator()
9749 if (!DC->isRecord() && NewFD->isExternallyVisible()) in ActOnFunctionDeclarator()
9750 AddPushedVisibilityAttribute(NewFD); in ActOnFunctionDeclarator()
9754 AddCFAuditedAttribute(NewFD); in ActOnFunctionDeclarator()
9759 AddRangeBasedOptnone(NewFD); in ActOnFunctionDeclarator()
9763 if (NewFD->isFirstDecl() && !NewFD->isInvalidDecl() && in ActOnFunctionDeclarator()
9764 isIncompleteDeclExternC(*this, NewFD)) in ActOnFunctionDeclarator()
9765 RegisterLocallyScopedExternCDecl(NewFD, S); in ActOnFunctionDeclarator()
9768 NewFD->setRangeEnd(D.getSourceRange().getEnd()); in ActOnFunctionDeclarator()
9772 checkDLLAttributeRedeclaration(*this, Prev, NewFD, in ActOnFunctionDeclarator()
9779 IdentifierInfo *II = NewFD->getIdentifier(); in ActOnFunctionDeclarator()
9781 !NewFD->isInvalidDecl() && in ActOnFunctionDeclarator()
9782 NewFD->getDeclContext()->getRedeclContext()->isTranslationUnit()) { in ActOnFunctionDeclarator()
9784 Diag(NewFD->getLocation(), diag::err_config_scalar_return) in ActOnFunctionDeclarator()
9786 Context.setcudaConfigureCallDecl(NewFD); in ActOnFunctionDeclarator()
9792 if (!getLangOpts().CUDAAllowVariadicFunctions && NewFD->isVariadic() && in ActOnFunctionDeclarator()
9793 (NewFD->hasAttr<CUDADeviceAttr>() || in ActOnFunctionDeclarator()
9794 NewFD->hasAttr<CUDAGlobalAttr>()) && in ActOnFunctionDeclarator()
9795 !(II && II->isStr("printf") && NewFD->isExternC() && in ActOnFunctionDeclarator()
9797 Diag(NewFD->getLocation(), diag::err_variadic_device_fn); in ActOnFunctionDeclarator()
9801 MarkUnusedFileScopedDecl(NewFD); in ActOnFunctionDeclarator()
9805 if (getLangOpts().OpenCL && NewFD->hasAttr<OpenCLKernelAttr>()) { in ActOnFunctionDeclarator()
9814 if (!NewFD->getReturnType()->isVoidType()) { in ActOnFunctionDeclarator()
9815 SourceRange RTRange = NewFD->getReturnTypeSourceRange(); in ActOnFunctionDeclarator()
9823 for (auto Param : NewFD->parameters()) in ActOnFunctionDeclarator()
9840 if (NewFD->isInvalidDecl()) in ActOnFunctionDeclarator()
9845 if (isMemberSpecialization && !NewFD->isInvalidDecl()) in ActOnFunctionDeclarator()
9846 CompleteMemberSpecialization(NewFD, Previous); in ActOnFunctionDeclarator()
9849 for (const ParmVarDecl *Param : NewFD->parameters()) { in ActOnFunctionDeclarator()
9871 Context, CurContext, NewFD->getLocation(), in ActOnFunctionDeclarator()
9872 cast<CXXMethodDecl>(NewFD), in ActOnFunctionDeclarator()
9880 if (const auto *attr = NewFD->getAttr<AvailabilityAttr>()) { in ActOnFunctionDeclarator()
9881 if (NewFD->hasAttr<ConstructorAttr>()) { in ActOnFunctionDeclarator()
9884 NewFD->dropAttr<AvailabilityAttr>(); in ActOnFunctionDeclarator()
9886 if (NewFD->hasAttr<DestructorAttr>()) { in ActOnFunctionDeclarator()
9889 NewFD->dropAttr<AvailabilityAttr>(); in ActOnFunctionDeclarator()
9900 if (const auto *NBA = NewFD->getAttr<NoBuiltinAttr>()) in ActOnFunctionDeclarator()
9916 return NewFD; in ActOnFunctionDeclarator()
10136 const FunctionDecl *OldFD, const FunctionDecl *NewFD, in areMultiversionVariantFunctionsCompatible() argument
10170 !NewFD->getType()->getAs<FunctionProtoType>()) in areMultiversionVariantFunctionsCompatible()
10171 return Diag(NewFD->getLocation(), NoProtoDiagID); in areMultiversionVariantFunctionsCompatible()
10174 NewFD->getTemplatedKind() == FunctionDecl::TK_FunctionTemplate) in areMultiversionVariantFunctionsCompatible()
10178 if (const auto *NewCXXFD = dyn_cast<CXXMethodDecl>(NewFD)) { in areMultiversionVariantFunctionsCompatible()
10192 if (NewFD->isDeleted()) in areMultiversionVariantFunctionsCompatible()
10196 if (NewFD->isDefaulted()) in areMultiversionVariantFunctionsCompatible()
10200 if (!ConstexprSupported && NewFD->isConstexpr()) in areMultiversionVariantFunctionsCompatible()
10202 << (NewFD->isConsteval() ? ConstevalFuncs : ConstexprFuncs); in areMultiversionVariantFunctionsCompatible()
10204 QualType NewQType = Context.getCanonicalType(NewFD->getType()); in areMultiversionVariantFunctionsCompatible()
10227 if (OldFD->getConstexprKind() != NewFD->getConstexprKind()) in areMultiversionVariantFunctionsCompatible()
10230 if (OldFD->isInlineSpecified() != NewFD->isInlineSpecified()) in areMultiversionVariantFunctionsCompatible()
10233 if (OldFD->getStorageClass() != NewFD->getStorageClass()) in areMultiversionVariantFunctionsCompatible()
10236 if (!CLinkageMayDiffer && OldFD->isExternC() != NewFD->isExternC()) in areMultiversionVariantFunctionsCompatible()
10241 NewFD->getType()->getAs<FunctionProtoType>(), NewFD->getLocation())) in areMultiversionVariantFunctionsCompatible()
10248 const FunctionDecl *NewFD, in CheckMultiVersionAdditionalRules() argument
10252 S.Diag(NewFD->getLocation(), diag::err_multiversion_not_supported); in CheckMultiVersionAdditionalRules()
10263 checkNonMultiVersionCompatAttributes(S, OldFD, NewFD, MVType)) in CheckMultiVersionAdditionalRules()
10266 if (checkNonMultiVersionCompatAttributes(S, NewFD, nullptr, MVType)) in CheckMultiVersionAdditionalRules()
10271 return S.Diag(NewFD->getLocation(), diag::err_multiversion_after_used); in CheckMultiVersionAdditionalRules()
10274 OldFD, NewFD, S.PDiag(diag::err_multiversion_noproto), in CheckMultiVersionAdditionalRules()
10275 PartialDiagnosticAt(NewFD->getLocation(), in CheckMultiVersionAdditionalRules()
10277 PartialDiagnosticAt(NewFD->getLocation(), in CheckMultiVersionAdditionalRules()
10280 PartialDiagnosticAt(NewFD->getLocation(), in CheckMultiVersionAdditionalRules()
10328 Sema &S, FunctionDecl *OldFD, FunctionDecl *NewFD, const TargetAttr *NewTA, in CheckTargetCausesMultiVersioning() argument
10344 S.Diag(NewFD->getLocation(), diag::err_multiversion_not_supported); in CheckTargetCausesMultiVersioning()
10346 NewFD->setInvalidDecl(); in CheckTargetCausesMultiVersioning()
10350 if (CheckMultiVersionAdditionalRules(S, OldFD, NewFD, true, in CheckTargetCausesMultiVersioning()
10352 NewFD->setInvalidDecl(); in CheckTargetCausesMultiVersioning()
10356 if (CheckMultiVersionValue(S, NewFD)) { in CheckTargetCausesMultiVersioning()
10357 NewFD->setInvalidDecl(); in CheckTargetCausesMultiVersioning()
10366 NewFD->setIsMultiVersion(); in CheckTargetCausesMultiVersioning()
10371 S.Diag(NewFD->getLocation(), diag::note_multiversioning_caused_here); in CheckTargetCausesMultiVersioning()
10372 NewFD->setInvalidDecl(); in CheckTargetCausesMultiVersioning()
10379 S.Diag(NewFD->getLocation(), diag::err_multiversion_duplicate); in CheckTargetCausesMultiVersioning()
10381 NewFD->setInvalidDecl(); in CheckTargetCausesMultiVersioning()
10393 S.Diag(NewFD->getLocation(), diag::note_multiversioning_caused_here); in CheckTargetCausesMultiVersioning()
10394 NewFD->setInvalidDecl(); in CheckTargetCausesMultiVersioning()
10400 NewFD->setIsMultiVersion(); in CheckTargetCausesMultiVersioning()
10411 Sema &S, FunctionDecl *OldFD, FunctionDecl *NewFD, in CheckMultiVersionAdditionalDecl() argument
10423 S.Diag(NewFD->getLocation(), diag::err_multiversion_types_mixed); in CheckMultiVersionAdditionalDecl()
10425 NewFD->setInvalidDecl(); in CheckMultiVersionAdditionalDecl()
10436 S.CurContext->isRecord() && !NewFD->getFriendObjectKind(); in CheckMultiVersionAdditionalDecl()
10444 if (S.IsOverload(NewFD, CurFD, UseMemberUsingDeclRules)) in CheckMultiVersionAdditionalDecl()
10450 NewFD->setIsMultiVersion(); in CheckMultiVersionAdditionalDecl()
10458 S.Diag(NewFD->getLocation(), diag::err_multiversion_duplicate); in CheckMultiVersionAdditionalDecl()
10460 NewFD->setInvalidDecl(); in CheckMultiVersionAdditionalDecl()
10478 NewFD->setIsMultiVersion(); in CheckMultiVersionAdditionalDecl()
10485 S.Diag(NewFD->getLocation(), diag::err_cpu_dispatch_mismatch); in CheckMultiVersionAdditionalDecl()
10487 NewFD->setInvalidDecl(); in CheckMultiVersionAdditionalDecl()
10499 NewFD->setIsMultiVersion(); in CheckMultiVersionAdditionalDecl()
10509 S.Diag(NewFD->getLocation(), diag::err_cpu_specific_multiple_defs) in CheckMultiVersionAdditionalDecl()
10512 NewFD->setInvalidDecl(); in CheckMultiVersionAdditionalDecl()
10527 CheckMultiVersionValue(S, NewFD)) { in CheckMultiVersionAdditionalDecl()
10528 NewFD->setInvalidDecl(); in CheckMultiVersionAdditionalDecl()
10532 if (CheckMultiVersionAdditionalRules(S, OldFD, NewFD, in CheckMultiVersionAdditionalDecl()
10534 NewFD->setInvalidDecl(); in CheckMultiVersionAdditionalDecl()
10541 NewFD->setIsMultiVersion(); in CheckMultiVersionAdditionalDecl()
10547 NewFD->setIsMultiVersion(); in CheckMultiVersionAdditionalDecl()
10562 static bool CheckMultiVersionFunction(Sema &S, FunctionDecl *NewFD, in CheckMultiVersionFunction() argument
10566 const auto *NewTA = NewFD->getAttr<TargetAttr>(); in CheckMultiVersionFunction()
10567 const auto *NewCPUDisp = NewFD->getAttr<CPUDispatchAttr>(); in CheckMultiVersionFunction()
10568 const auto *NewCPUSpec = NewFD->getAttr<CPUSpecificAttr>(); in CheckMultiVersionFunction()
10573 S.Diag(NewFD->getLocation(), diag::err_multiversion_types_mixed); in CheckMultiVersionFunction()
10574 NewFD->setInvalidDecl(); in CheckMultiVersionFunction()
10578 MultiVersionKind MVType = NewFD->getMultiVersionKind(); in CheckMultiVersionFunction()
10582 if (NewFD->isMain()) { in CheckMultiVersionFunction()
10586 S.Diag(NewFD->getLocation(), diag::err_multiversion_not_allowed_on_main); in CheckMultiVersionFunction()
10587 NewFD->setInvalidDecl(); in CheckMultiVersionFunction()
10595 NewFD->getDeclContext()->getRedeclContext()) { in CheckMultiVersionFunction()
10600 return CheckMultiVersionFirstFunction(S, NewFD, MVType, NewTA); in CheckMultiVersionFunction()
10609 S.Diag(NewFD->getLocation(), diag::err_multiversion_required_in_redecl) in CheckMultiVersionFunction()
10611 NewFD->setInvalidDecl(); in CheckMultiVersionFunction()
10617 return CheckTargetCausesMultiVersioning(S, OldFD, NewFD, NewTA, in CheckMultiVersionFunction()
10625 S, OldFD, NewFD, MVType, NewTA, NewCPUDisp, NewCPUSpec, Redeclaration, in CheckMultiVersionFunction()
10646 bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD, in CheckFunctionDeclaration() argument
10649 assert(!NewFD->getReturnType()->isVariablyModifiedType() && in CheckFunctionDeclaration()
10669 if (!AllowOverloadingOfFunction(Previous, Context, NewFD)) { in CheckFunctionDeclaration()
10671 if (shouldLinkPossiblyHiddenDecl(Candidate, NewFD)) { in CheckFunctionDeclaration()
10677 switch (CheckOverload(S, NewFD, Previous, OldDecl, in CheckFunctionDeclaration()
10696 checkForConflictWithNonVisibleExternC(*this, NewFD, Previous)) { in CheckFunctionDeclaration()
10706 NewFD->hasAttr<OverloadableAttr>()) { in CheckFunctionDeclaration()
10707 if (IsOverload(NewFD, cast<FunctionDecl>(OldDecl), false)) { in CheckFunctionDeclaration()
10716 if (CheckMultiVersionFunction(*this, NewFD, Redeclaration, OldDecl, in CheckFunctionDeclaration()
10722 CheckPPCMMAType(NewFD->getReturnType(), NewFD->getLocation())) { in CheckFunctionDeclaration()
10723 NewFD->setInvalidDecl(); in CheckFunctionDeclaration()
10735 CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(NewFD); in CheckFunctionDeclaration()
10767 if (MergeFunctionDecl(NewFD, OldDecl, S, MergeTypeWithPrevious)) { in CheckFunctionDeclaration()
10768 NewFD->setInvalidDecl(); in CheckFunctionDeclaration()
10779 = NewFD->getDescribedFunctionTemplate(); in CheckFunctionDeclaration()
10787 NewFD->setPreviousDeclaration(OldFD); in CheckFunctionDeclaration()
10788 adjustDeclContextForDeclaratorDecl(NewFD, OldFD); in CheckFunctionDeclaration()
10789 if (NewFD->isCXXClassMember()) { in CheckFunctionDeclaration()
10790 NewFD->setAccess(OldTemplateDecl->getAccess()); in CheckFunctionDeclaration()
10811 if (shouldLinkDependentDeclWithPrevious(NewFD, OldDecl)) { in CheckFunctionDeclaration()
10814 NewFD->setPreviousDeclaration(OldFD); in CheckFunctionDeclaration()
10815 adjustDeclContextForDeclaratorDecl(NewFD, OldFD); in CheckFunctionDeclaration()
10816 if (NewFD->isCXXClassMember()) in CheckFunctionDeclaration()
10817 NewFD->setAccess(OldFD->getAccess()); in CheckFunctionDeclaration()
10821 !NewFD->getAttr<OverloadableAttr>()) { in CheckFunctionDeclaration()
10835 Diag(NewFD->getLocation(), in CheckFunctionDeclaration()
10841 NewFD->addAttr(OverloadableAttr::CreateImplicit(Context)); in CheckFunctionDeclaration()
10849 if (CXXConstructorDecl *Constructor = dyn_cast<CXXConstructorDecl>(NewFD)) { in CheckFunctionDeclaration()
10852 dyn_cast<CXXDestructorDecl>(NewFD)) { in CheckFunctionDeclaration()
10862 if (NewFD->getDeclName() != Name) { in CheckFunctionDeclaration()
10863 Diag(NewFD->getLocation(), diag::err_destructor_name); in CheckFunctionDeclaration()
10864 NewFD->setInvalidDecl(); in CheckFunctionDeclaration()
10868 } else if (auto *Guide = dyn_cast<CXXDeductionGuideDecl>(NewFD)) { in CheckFunctionDeclaration()
10880 if (CXXMethodDecl *Method = dyn_cast<CXXMethodDecl>(NewFD)) { in CheckFunctionDeclaration()
10886 if (Method->isVirtual() && NewFD->getTrailingRequiresClause()) in CheckFunctionDeclaration()
10889 Diag(NewFD->getTrailingRequiresClause()->getBeginLoc(), in CheckFunctionDeclaration()
10896 if (CXXConversionDecl *Conversion = dyn_cast<CXXConversionDecl>(NewFD)) in CheckFunctionDeclaration()
10900 if (NewFD->isOverloadedOperator() && in CheckFunctionDeclaration()
10901 CheckOverloadedOperatorDeclaration(NewFD)) { in CheckFunctionDeclaration()
10902 NewFD->setInvalidDecl(); in CheckFunctionDeclaration()
10907 if (NewFD->getLiteralIdentifier() && in CheckFunctionDeclaration()
10908 CheckLiteralOperatorDeclaration(NewFD)) { in CheckFunctionDeclaration()
10909 NewFD->setInvalidDecl(); in CheckFunctionDeclaration()
10917 CheckCXXDefaultArguments(NewFD); in CheckFunctionDeclaration()
10921 if (unsigned BuiltinID = NewFD->getBuiltinID()) { in CheckFunctionDeclaration()
10931 NewFD->getType())) in CheckFunctionDeclaration()
10941 if (Previous.empty() && NewFD->isExternC()) { in CheckFunctionDeclaration()
10942 QualType R = NewFD->getReturnType(); in CheckFunctionDeclaration()
10944 Diag(NewFD->getLocation(), diag::warn_return_value_udt_incomplete) in CheckFunctionDeclaration()
10945 << NewFD << R; in CheckFunctionDeclaration()
10948 Diag(NewFD->getLocation(), diag::warn_return_value_udt) << NewFD << R; in CheckFunctionDeclaration()
10960 if (!getLangOpts().CPlusPlus17 && !NewFD->getPrimaryTemplate()) { in CheckFunctionDeclaration()
10977 auto *FPT = NewFD->getType()->castAs<FunctionProtoType>(); in CheckFunctionDeclaration()
10982 Diag(NewFD->getLocation(), in CheckFunctionDeclaration()
10984 << NewFD; in CheckFunctionDeclaration()
10988 checkCUDATargetOverload(NewFD, Previous); in CheckFunctionDeclaration()
16603 FieldDecl *NewFD in HandleField() local
16607 if (NewFD->isInvalidDecl()) in HandleField()
16611 NewFD->setModulePrivate(); in HandleField()
16613 if (NewFD->isInvalidDecl() && PrevDecl) { in HandleField()
16617 PushOnScopeChains(NewFD, S); in HandleField()
16619 Record->addDecl(NewFD); in HandleField()
16621 return NewFD; in HandleField()
16756 FieldDecl *NewFD = FieldDecl::Create(Context, Record, TSSL, Loc, II, T, TInfo, in CheckFieldDecl() local
16759 NewFD->setInvalidDecl(); in CheckFieldDecl()
16764 NewFD->setInvalidDecl(); in CheckFieldDecl()
16777 if (CheckNontrivialField(NewFD)) in CheckFieldDecl()
16778 NewFD->setInvalidDecl(); in CheckFieldDecl()
16786 Diag(NewFD->getLocation(), getLangOpts().MicrosoftExt ? in CheckFieldDecl()
16789 << NewFD->getDeclName() << EltTy; in CheckFieldDecl()
16791 NewFD->setInvalidDecl(); in CheckFieldDecl()
16800 ProcessDeclAttributes(getCurScope(), NewFD, *D); in CheckFieldDecl()
16802 if (NewFD->hasAttrs()) in CheckFieldDecl()
16803 CheckAlignasUnderalignment(NewFD); in CheckFieldDecl()
16808 if (getLangOpts().ObjCAutoRefCount && inferObjCARCLifetime(NewFD)) in CheckFieldDecl()
16809 NewFD->setInvalidDecl(); in CheckFieldDecl()
16816 CheckPPCMMAType(T, NewFD->getLocation())) in CheckFieldDecl()
16817 NewFD->setInvalidDecl(); in CheckFieldDecl()
16819 NewFD->setAccess(AS); in CheckFieldDecl()
16820 return NewFD; in CheckFieldDecl()