reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced

References

tools/clang/lib/Sema/SemaDecl.cpp
 8602   if (!NewFD) return nullptr;
 8605     NewFD->setTopLevelDeclInObjCContainer();
 8610   NewFD->setLexicalDeclContext(CurContext);
 8613     NewFD->setLocalExternDecl();
 8624       NewFD->setImplicitlyInline();
 8631           dyn_cast<CXXRecordDecl>(NewFD->getDeclContext())) {
 8632       if (Parent->isInterface() && cast<CXXMethodDecl>(NewFD)->isUserProvided())
 8633         NewFD->setPure(true);
 8641     SetNestedNameSpecifier(*this, NewFD, D);
 8645       NewFD->setInvalidDecl();
 8664           NewFD->setInvalidDecl();
 8668           Diag(NewFD->getLocation(), diag::err_destructor_template);
 8669           NewFD->setInvalidDecl();
 8682                                                         NewFD->getLocation(),
 8684                                                         NewFD);
 8686         NewFD->setDescribedFunctionTemplate(FunctionTemplate);
 8690           NewFD->setTemplateParameterListsInfo(Context,
 8698           NewFD->setTemplateParameterListsInfo(Context, TemplateParamLists);
 8727         NewFD->setTemplateParameterListsInfo(Context, TemplateParamLists);
 8731       NewFD->setInvalidDecl();
 8741     if (isVirtual && !NewFD->isInvalidDecl()) {
 8750       } else if (NewFD->getDescribedFunctionTemplate()) {
 8758         NewFD->setVirtualAsWritten(true);
 8762           NewFD->getReturnType()->isUndeducedType())
 8767         (NewFD->isDependentContext() ||
 8769         NewFD->getReturnType()->isUndeducedType()) {
 8777           NewFD->getType()->castAs<FunctionProtoType>();
 8780       NewFD->setType(Context.getFunctionType(Result, FPT->getParamTypes(),
 8787     if (isInline && !NewFD->isInvalidDecl()) {
 8800     if (hasExplicit && !NewFD->isInvalidDecl() &&
 8801         !isa<CXXDeductionGuideDecl>(NewFD)) {
 8807       } else if (!isa<CXXConstructorDecl>(NewFD) &&
 8808                  !isa<CXXConversionDecl>(NewFD)) {
 8821       NewFD->setImplicitlyInline();
 8826       if (isa<CXXDestructorDecl>(NewFD) && !getLangOpts().CPlusPlus2a) {
 8841         NewFD->setModulePrivate();
 8852       NewFD->setObjectOfFriendDecl();
 8853       NewFD->setAccess(AS_public);
 8865         NewFD->setDefaulted();
 8869         NewFD->setDeletedAsWritten();
 8873     if (isa<CXXMethodDecl>(NewFD) && DC == CurContext &&
 8878       NewFD->setImplicitlyInline();
 8881     if (SC == SC_Static && isa<CXXMethodDecl>(NewFD) &&
 8897            (getLangOpts().MSVCCompat && NewFD->getDescribedFunctionTemplate()))
 8909       NewFD->setType(Context.getFunctionType(
 8915   FilterLookupForScope(Previous, OriginalDC, S, shouldConsiderLinkage(NewFD),
 8924     NewFD->addAttr(::new (Context)
 8929       ExtnameUndeclaredIdentifiers.find(NewFD->getIdentifier());
 8931       if (isDeclExternC(NewFD)) {
 8932         NewFD->addAttr(I->second);
 8935         Diag(NewFD->getLocation(), diag::warn_redefine_extname_not_applied)
 8936             << /*Variable*/0 << NewFD;
 8955         assert(Param->getDeclContext() != NewFD && "Was set before ?");
 8956         Param->setDeclContext(NewFD);
 8960           NewFD->setInvalidDecl();
 8970           getTagInjectionContext(NewFD->getLexicalDeclContext());
 8986         TD->setDeclContext(NewFD);
 8987         NewFD->addDecl(TD);
 9011           BuildParmVarDeclForTypedef(NewFD, D.getIdentifierLoc(), AI);
 9016     assert(R->isFunctionNoProtoType() && NewFD->getNumParams() == 0 &&
 9021   NewFD->setParams(Params);
 9024     NewFD->addAttr(C11NoReturnAttr::Create(Context,
 9030   if (!NewFD->isInvalidDecl() &&
 9031       NewFD->getReturnType()->isVariablyModifiedType()) {
 9032     Diag(NewFD->getLocation(), diag::err_vm_func_decl);
 9033     NewFD->setInvalidDecl();
 9038       !NewFD->hasAttr<SectionAttr>())
 9039     NewFD->addAttr(PragmaClangTextSectionAttr::CreateImplicit(
 9045       !NewFD->hasAttr<SectionAttr>()) {
 9046     NewFD->addAttr(SectionAttr::CreateImplicit(
 9053                      NewFD))
 9054       NewFD->dropAttr<SectionAttr>();
 9059   if (!NewFD->hasAttr<CodeSegAttr>()) {
 9060     if (Attr *SAttr = getImplicitCodeSegOrSectionAttrForFunction(NewFD,
 9062       NewFD->addAttr(SAttr);
 9067   ProcessDeclAttributes(S, NewFD, D);
 9072     LangAS AddressSpace = NewFD->getReturnType().getAddressSpace();
 9074       Diag(NewFD->getLocation(),
 9076       NewFD->setInvalidDecl();
 9082     if (!NewFD->isInvalidDecl() && NewFD->isMain())
 9082     if (!NewFD->isInvalidDecl() && NewFD->isMain())
 9083       CheckMain(NewFD, D.getDeclSpec());
 9085     if (!NewFD->isInvalidDecl() && NewFD->isMSVCRTEntryPoint())
 9085     if (!NewFD->isInvalidDecl() && NewFD->isMSVCRTEntryPoint())
 9086       CheckMSVCRTEntryPoint(NewFD);
 9088     if (!NewFD->isInvalidDecl())
 9089       D.setRedeclaration(CheckFunctionDeclaration(S, NewFD, Previous,
 9094     assert((NewFD->isInvalidDecl() || !D.isRedeclaration() ||
 9101     const FunctionType *FT = NewFD->getType()->castAs<FunctionType>();
 9109         Diag(NewFD->getLocation(), DiagID)
 9114    if (NewFD->getReturnType().hasNonTrivialToPrimitiveDestructCUnion() ||
 9115        NewFD->getReturnType().hasNonTrivialToPrimitiveCopyCUnion())
 9116      checkNonTrivialCUnion(NewFD->getReturnType(),
 9117                            NewFD->getReturnTypeSourceRange().getBegin(),
 9128         NewFD->isReplaceableGlobalAllocationFunction() &&
 9129         !NewFD->hasAttr<UsedAttr>())
 9132         << NewFD->getDeclName();
 9147       if (NewFD->isInvalidDecl()) {
 9181       maybeAddCUDAHostDeviceAttrs(NewFD, Previous);
 9189         (NewFD->getType()->isDependentType() || DC->isDependentContext() ||
 9195       if (CheckDependentFunctionTemplateSpecialization(NewFD, TemplateArgs,
 9197         NewFD->setInvalidDecl();
 9202       } else if (!NewFD->isInvalidDecl() &&
 9204                      NewFD, (HasExplicitTemplateArgs ? &TemplateArgs : nullptr),
 9206         NewFD->setInvalidDecl();
 9212           NewFD->getTemplateSpecializationInfo();
 9215           Diag(NewFD->getLocation(),
 9222           Diag(NewFD->getLocation(),
 9227     } else if (isMemberSpecialization && isa<CXXMethodDecl>(NewFD)) {
 9228       if (CheckMemberSpecialization(NewFD, Previous))
 9229           NewFD->setInvalidDecl();
 9234       if (!NewFD->isInvalidDecl() && NewFD->isMain())
 9234       if (!NewFD->isInvalidDecl() && NewFD->isMain())
 9235         CheckMain(NewFD, D.getDeclSpec());
 9237       if (!NewFD->isInvalidDecl() && NewFD->isMSVCRTEntryPoint())
 9237       if (!NewFD->isInvalidDecl() && NewFD->isMSVCRTEntryPoint())
 9238         CheckMSVCRTEntryPoint(NewFD);
 9240       if (!NewFD->isInvalidDecl())
 9241         D.setRedeclaration(CheckFunctionDeclaration(S, NewFD, Previous,
 9248     assert((NewFD->isInvalidDecl() || !D.isRedeclaration() ||
 9254                                 : NewFD);
 9256     if (isFriend && NewFD->getPreviousDecl()) {
 9258       if (!NewFD->isInvalidDecl())
 9259         Access = NewFD->getPreviousDecl()->getAccess();
 9261       NewFD->setAccess(Access);
 9265     if (NewFD->isOverloadedOperator() && !DC->isRecord() &&
 9288     if (NewFD->isInvalidDecl()) {
 9294       if (isa<CXXRecordDecl>(NewFD->getDeclContext()))
 9295         NewFD->setAccess(AS_public);
 9333                   *this, Previous, NewFD, ExtraArgs, false, nullptr)) {
 9343                 *this, Previous, NewFD, ExtraArgs, true, S)) {
 9349                isa<CXXMethodDecl>(NewFD) && NewFD->isOutOfLine() &&
 9349                isa<CXXMethodDecl>(NewFD) && NewFD->isOutOfLine() &&
 9359       Diag(NewFD->getLocation(), diag::ext_out_of_line_declaration)
 9364   ProcessPragmaWeak(S, NewFD);
 9365   checkAttributesAfterMerging(*this, *NewFD);
 9367   AddKnownFunctionAttributes(NewFD);
 9369   if (NewFD->hasAttr<OverloadableAttr>() &&
 9370       !NewFD->getType()->getAs<FunctionProtoType>()) {
 9371     Diag(NewFD->getLocation(),
 9373       << NewFD;
 9376     const FunctionType *FT = NewFD->getType()->getAs<FunctionType>();
 9383     NewFD->setType(R);
 9388   if (!DC->isRecord() && NewFD->isExternallyVisible())
 9389     AddPushedVisibilityAttribute(NewFD);
 9393   AddCFAuditedAttribute(NewFD);
 9398     AddRangeBasedOptnone(NewFD);
 9402   if (NewFD->isFirstDecl() && !NewFD->isInvalidDecl() &&
 9402   if (NewFD->isFirstDecl() && !NewFD->isInvalidDecl() &&
 9403       isIncompleteDeclExternC(*this, NewFD))
 9404     RegisterLocallyScopedExternCDecl(NewFD, S);
 9407   NewFD->setRangeEnd(D.getSourceRange().getEnd());
 9411     checkDLLAttributeRedeclaration(*this, Prev, NewFD,
 9418     IdentifierInfo *II = NewFD->getIdentifier();
 9420         !NewFD->isInvalidDecl() &&
 9421         NewFD->getDeclContext()->getRedeclContext()->isTranslationUnit()) {
 9423         Diag(NewFD->getLocation(), diag::err_config_scalar_return)
 9425       Context.setcudaConfigureCallDecl(NewFD);
 9431     if (!getLangOpts().CUDAAllowVariadicFunctions && NewFD->isVariadic() &&
 9432         (NewFD->hasAttr<CUDADeviceAttr>() ||
 9433          NewFD->hasAttr<CUDAGlobalAttr>()) &&
 9434         !(II && II->isStr("printf") && NewFD->isExternC() &&
 9436       Diag(NewFD->getLocation(), diag::err_variadic_device_fn);
 9440   MarkUnusedFileScopedDecl(NewFD);
 9444   if (getLangOpts().OpenCL && NewFD->hasAttr<OpenCLKernelAttr>()) {
 9453     if (!NewFD->getReturnType()->isVoidType()) {
 9454       SourceRange RTRange = NewFD->getReturnTypeSourceRange();
 9462     for (auto Param : NewFD->parameters())
 9479       if (NewFD->isInvalidDecl())
 9484     if (isMemberSpecialization && !NewFD->isInvalidDecl())
 9485       CompleteMemberSpecialization(NewFD, Previous);
 9488   for (const ParmVarDecl *Param : NewFD->parameters()) {
 9510                                 Context, CurContext, NewFD->getLocation(),
 9511                                 cast<CXXMethodDecl>(NewFD),
 9519   if (const auto *attr = NewFD->getAttr<AvailabilityAttr>()) {
 9520     if (NewFD->hasAttr<ConstructorAttr>()) {
 9523       NewFD->dropAttr<AvailabilityAttr>();
 9525     if (NewFD->hasAttr<DestructorAttr>()) {
 9528       NewFD->dropAttr<AvailabilityAttr>();
 9532   return NewFD;