Lines Matching refs:NewFD
4554 Sema &SemaRef, LookupResult &Previous, FunctionDecl *NewFD,
4557 DeclarationName Name = NewFD->getDeclName();
4558 DeclContext *NewDC = NewFD->getDeclContext();
4559 LookupResult Prev(SemaRef, Name, NewFD->getLocation(),
4569 NewFD->setInvalidDecl();
4573 CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(NewFD);
4580 hasSimilarParameters(SemaRef.Context, FD, NewFD, MismatchedParams)) {
4604 if (FD && hasSimilarParameters(SemaRef.Context, FD, NewFD,
4616 NewFD->getTypeSourceInfo(), Previous, ExtraArgs.TemplateParamLists,
4644 SemaRef.Diag(NewFD->getLocation(), DiagMsg)
4647 NewFD->getLocation(),
4650 SemaRef.Diag(NewFD->getLocation(), DiagMsg)
4651 << Name << NewDC << NewFD->getLocation();
4654 if (CXXMethodDecl *NewMD = dyn_cast<CXXMethodDecl>(NewFD))
4670 << Idx << FDParam->getType() << NewFD->getParamDecl(Idx-1)->getType();
4724 FunctionDecl *NewFD = 0;
4740 NewFD = FunctionDecl::Create(SemaRef.Context, DC,
4745 NewFD->setInvalidDecl();
4748 NewFD->setLexicalDeclContext(SemaRef.CurContext);
4750 return NewFD;
4917 FunctionDecl *NewFD = CreateNewFunctionDecl(*this, D, DC, R, TInfo, SC,
4919 if (!NewFD) return 0;
4922 NewFD->setTopLevelDeclInObjCContainer();
4934 NewFD->setImplicitlyInline();
4937 SetNestedNameSpecifier(NewFD, D);
4941 NewFD->setInvalidDecl();
4946 NewFD->setLexicalDeclContext(CurContext);
4970 Diag(NewFD->getLocation(), diag::err_destructor_template);
4985 NewFD->getLocation(),
4987 NewFD);
4989 NewFD->setDescribedFunctionTemplate(FunctionTemplate);
4993 NewFD->setTemplateParameterListsInfo(Context,
5001 NewFD->setTemplateParameterListsInfo(Context,
5033 NewFD->setTemplateParameterListsInfo(Context,
5039 NewFD->setInvalidDecl();
5074 << FixItHint::CreateReplacement(D.getCommaLoc(), ";") << NewFD;
5099 if (isVirtual && !NewFD->isInvalidDecl()) {
5108 } else if (NewFD->getDescribedFunctionTemplate()) {
5116 NewFD->setVirtualAsWritten(true);
5123 if (isInline && !NewFD->isInvalidDecl()) {
5136 if (isExplicit && !NewFD->isInvalidDecl()) {
5142 } else if (!isa<CXXConstructorDecl>(NewFD) &&
5143 !isa<CXXConversionDecl>(NewFD)) {
5155 NewFD->setImplicitlyInline();
5160 if (isa<CXXDestructorDecl>(NewFD))
5173 NewFD->setModulePrivate();
5185 NewFD->setObjectOfFriendDecl(false);
5186 NewFD->setAccess(AS_public);
5196 NewFD->setDefaulted();
5200 NewFD->setDeletedAsWritten();
5204 if (isa<CXXMethodDecl>(NewFD) && DC == CurContext &&
5209 NewFD->setImplicitlyInline();
5212 if (SC == SC_Static && isa<CXXMethodDecl>(NewFD) &&
5228 FilterLookupForScope(Previous, DC, S, NewFD->hasLinkage(),
5236 NewFD->addAttr(::new (Context) AsmLabelAttr(SE->getStrTokenLoc(0), Context,
5240 ExtnameUndeclaredIdentifiers.find(NewFD->getIdentifier());
5242 NewFD->addAttr(I->second);
5248 // declaration NewFD, if they are available. First scavenge them into Params.
5280 assert(Param->getDeclContext() != NewFD && "Was set before ?");
5281 Param->setDeclContext(NewFD);
5285 NewFD->setInvalidDecl();
5303 BuildParmVarDeclForTypedef(NewFD, D.getIdentifierLoc(), *AI);
5308 assert(R->isFunctionNoProtoType() && NewFD->getNumParams() == 0 &&
5313 NewFD->setParams(Params);
5316 // and add to NewFD. This lets us track decls such 'enum Y' in:
5321 NewFD->setDeclsInPrototypeScope(DeclsInPrototypeScope);
5325 ProcessDeclAttributes(S, NewFD, D,
5330 if (!NewFD->isInvalidDecl() &&
5331 NewFD->getResultType()->isVariablyModifiedType()) {
5332 Diag(NewFD->getLocation(), diag::err_vm_func_decl);
5333 NewFD->setInvalidDecl();
5339 if (!NewFD->isInvalidDecl()) {
5340 if (NewFD->isMain())
5341 CheckMain(NewFD, D.getDeclSpec());
5342 D.setRedeclaration(CheckFunctionDeclaration(S, NewFD, Previous,
5345 assert((NewFD->isInvalidDecl() || !D.isRedeclaration() ||
5366 if (NewFD->isInvalidDecl()) {
5408 (NewFD->getType()->isDependentType() || DC->isDependentContext() ||
5414 if (CheckDependentFunctionTemplateSpecialization(NewFD, TemplateArgs,
5416 NewFD->setInvalidDecl();
5421 Diag(NewFD->getLocation(), getLangOpts().MicrosoftExt ?
5424 << NewFD->getDeclName();
5425 } else if (CheckFunctionTemplateSpecialization(NewFD,
5428 NewFD->setInvalidDecl();
5434 if (SC != NewFD->getStorageClass())
5435 Diag(NewFD->getLocation(),
5442 Diag(NewFD->getLocation(),
5448 } else if (isExplicitSpecialization && isa<CXXMethodDecl>(NewFD)) {
5449 if (CheckMemberSpecialization(NewFD, Previous))
5450 NewFD->setInvalidDecl();
5455 if (NewFD->isInvalidDecl()) {
5458 if (CXXMethodDecl* methodDecl = dyn_cast<CXXMethodDecl>(NewFD))
5461 if (NewFD->isMain())
5462 CheckMain(NewFD, D.getDeclSpec());
5463 D.setRedeclaration(CheckFunctionDeclaration(S, NewFD, Previous,
5468 assert((NewFD->isInvalidDecl() || !D.isRedeclaration() ||
5474 : NewFD);
5478 if (!NewFD->isInvalidDecl())
5479 Access = NewFD->getPreviousDecl()->getAccess();
5481 NewFD->setAccess(Access);
5487 if (NewFD->isOverloadedOperator() && !DC->isRecord() &&
5509 if (NewFD->isInvalidDecl()) {
5515 if (isa<CXXRecordDecl>(NewFD->getDeclContext()))
5516 NewFD->setAccess(AS_public);
5551 NewFD,
5562 NewFD,
5579 Diag(NewFD->getLocation(), diag::ext_out_of_line_declaration)
5589 ProcessDeclAttributes(S, NewFD, D,
5598 Diag(NewFD->getLocation(), diag::warn_attribute_precede_definition);
5603 AddKnownFunctionAttributes(NewFD);
5605 if (NewFD->hasAttr<OverloadableAttr>() &&
5606 !NewFD->getType()->getAs<FunctionProtoType>()) {
5607 Diag(NewFD->getLocation(),
5609 << NewFD;
5612 const FunctionType *FT = NewFD->getType()->getAs<FunctionType>();
5618 NewFD->setType(R);
5623 if (NewFD->getLinkage() == ExternalLinkage && !DC->isRecord())
5624 AddPushedVisibilityAttribute(NewFD);
5628 AddCFAuditedAttribute(NewFD);
5632 if (CurContext->isFunctionOrMethod() && NewFD->isExternC()
5633 && !NewFD->isInvalidDecl())
5634 RegisterLocallyScopedExternCDecl(NewFD, Previous, S);
5637 NewFD->setRangeEnd(D.getSourceRange().getEnd());
5641 if (NewFD->isInvalidDecl())
5647 MarkUnusedFileScopedDecl(NewFD);
5650 if (IdentifierInfo *II = NewFD->getIdentifier())
5651 if (!NewFD->isInvalidDecl() &&
5652 NewFD->getDeclContext()->getRedeclContext()->isTranslationUnit()) {
5655 Diag(NewFD->getLocation(), diag::err_config_scalar_return);
5657 Context.setcudaConfigureCallDecl(NewFD);
5668 cast<CXXMethodDecl>(NewFD));
5673 return NewFD;
5679 /// NewFD. This routine performs all semantic checking that does not
5689 /// This sets NewFD->isInvalidDecl() to true if there was an error.
5692 bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD,
5695 assert(!NewFD->getResultType()->isVariablyModifiedType()
5699 if (Previous.empty() && NewFD->isExternC()) {
5704 = findLocallyScopedExternalDecl(NewFD->getDeclName());
5714 // Determine whether NewFD is an overload of PrevDecl or
5724 switch (CheckOverload(S, NewFD, Previous, OldDecl,
5739 if (!getLangOpts().CPlusPlus && !NewFD->hasAttr<OverloadableAttr>()) {
5742 Diag(NewFD->getLocation(), diag::err_attribute_overloadable_missing)
5743 << Redeclaration << NewFD;
5752 NewFD->addAttr(::new (Context) OverloadableAttr(SourceLocation(),
5758 // NewFD and OldDecl represent declarations that need to be
5760 if (MergeFunctionDecl(NewFD, OldDecl, S)) {
5761 NewFD->setInvalidDecl();
5770 NewFD->setPreviousDeclaration(OldTemplateDecl->getTemplatedDecl());
5772 = NewFD->getDescribedFunctionTemplate();
5789 if (isa<CXXMethodDecl>(NewFD)) // Set access for out-of-line definitions
5790 NewFD->setAccess(OldDecl->getAccess());
5791 NewFD->setPreviousDeclaration(cast<FunctionDecl>(OldDecl));
5799 if (CXXConstructorDecl *Constructor = dyn_cast<CXXConstructorDecl>(NewFD)) {
5802 dyn_cast<CXXDestructorDecl>(NewFD)) {
5812 if (NewFD->getDeclName() != Name) {
5813 Diag(NewFD->getLocation(), diag::err_destructor_name);
5814 NewFD->setInvalidDecl();
5819 = dyn_cast<CXXConversionDecl>(NewFD)) {
5824 if (CXXMethodDecl *Method = dyn_cast<CXXMethodDecl>(NewFD)) {
5829 if (NewFD->getStorageClass() == SC_Static) {
5830 Diag(NewFD->getLocation(), diag::err_static_overrides_virtual)
5831 << NewFD->getDeclName();
5849 if (NewFD->isOverloadedOperator() &&
5850 CheckOverloadedOperatorDeclaration(NewFD)) {
5851 NewFD->setInvalidDecl();
5856 if (NewFD->getLiteralIdentifier() &&
5857 CheckLiteralOperatorDeclaration(NewFD)) {
5858 NewFD->setInvalidDecl();
5866 CheckCXXDefaultArguments(NewFD);
5870 if (unsigned BuiltinID = NewFD->getBuiltinID()) {
5873 if (!T.isNull() && !Context.hasSameType(T, NewFD->getType())) {
5883 if (NewFD->isExternC()) {
5884 QualType R = NewFD->getResultType();
5887 Diag( NewFD->getLocation(), diag::warn_return_value_udt )
5888 << NewFD << R;
8921 FieldDecl *NewFD
8925 if (NewFD->isInvalidDecl())
8929 NewFD->setModulePrivate();
8931 if (NewFD->isInvalidDecl() && PrevDecl) {
8932 // Don't introduce NewFD into scope; there's already something
8935 PushOnScopeChains(NewFD, S);
8937 Record->addDecl(NewFD);
8939 return NewFD;
9044 FieldDecl *NewFD = FieldDecl::Create(Context, Record, TSSL, Loc, II, T, TInfo,
9047 NewFD->setInvalidDecl();
9052 NewFD->setInvalidDecl();
9065 if (CheckNontrivialField(NewFD))
9066 NewFD->setInvalidDecl();
9073 Diag(NewFD->getLocation(), diag::err_union_member_of_reference_type)
9074 << NewFD->getDeclName() << EltTy;
9075 NewFD->setInvalidDecl();
9084 ProcessDeclAttributes(TUScope, NewFD, *D);
9088 if (getLangOpts().ObjCAutoRefCount && inferObjCARCLifetime(NewFD))
9089 NewFD->setInvalidDecl();
9094 NewFD->setAccess(AS);
9095 return NewFD;