Lines Matching defs:PrevDecl
1183 /// PrevDecl with another declaration.
3970 NamedDecl *PrevDecl = R.getRepresentativeDecl()->getUnderlyingDecl();
3971 assert(PrevDecl && "Expected a non-null Decl");
3973 if (!SemaRef.isDeclInScope(PrevDecl, Owner, S))
3978 SemaRef.Diag(PrevDecl->getLocation(), diag::note_previous_declaration);
5294 /// previous declaration (PrevDecl) that is not in the scope where a
5300 /// \param PrevDecl the previous declaration found by name
5306 /// \returns true if PrevDecl is an out-of-scope previous declaration
5309 isOutOfScopePreviousDeclaration(NamedDecl *PrevDecl, DeclContext *DC,
5311 if (!PrevDecl)
5314 if (!PrevDecl->hasLinkage())
5329 DeclContext *PrevOuterContext = PrevDecl->getDeclContext();
8326 // Determine whether NewFD is an overload of PrevDecl or
10445 NamedDecl *PrevDecl = R.getFoundDecl();
10446 if (PrevDecl->isTemplateParameter()) {
10448 DiagnoseTemplateParameterShadow(D.getIdentifierLoc(), PrevDecl);
10450 PrevDecl = nullptr;
10451 } else if (S->isDeclScope(PrevDecl)) {
10453 Diag(PrevDecl->getLocation(), diag::note_previous_declaration);
12162 NamedDecl *PrevDecl = Previous.getFoundDecl();
12175 if (TypedefNameDecl *TD = dyn_cast<TypedefNameDecl>(PrevDecl)) {
12181 PrevDecl = Tag;
12194 auto *OldTag = dyn_cast<TagDecl>(PrevDecl);
12210 if (TagDecl *PrevTagDecl = dyn_cast<TagDecl>(PrevDecl)) {
12276 if (TUK == TUK_Declaration && PrevDecl->isCXXClassMember() &&
12277 S->isDeclScope(PrevDecl)) {
12372 // new decl/type. We set PrevDecl to NULL so that the entities
12376 // If we get here, we're going to create a new Decl. If PrevDecl
12378 // PrevDecl. If it's NULL, we have a new definition.
12381 // Otherwise, PrevDecl is not a tag, but was found with tag
12391 if (isa<TypedefDecl>(PrevDecl)) Kind = 1;
12392 else if (isa<TypeAliasDecl>(PrevDecl)) Kind = 2;
12393 else if (isa<ClassTemplateDecl>(PrevDecl)) Kind = 3;
12395 Diag(PrevDecl->getLocation(), diag::note_declared_at);
12406 if (isa<TypedefDecl>(PrevDecl)) Kind = 1;
12407 else if (isa<TypeAliasDecl>(PrevDecl)) Kind = 2;
12408 else if (isa<ClassTemplateDecl>(PrevDecl)) Kind = 3;
12410 Diag(PrevDecl->getLocation(), diag::note_previous_decl) << PrevDecl;
12415 } else if (TypedefNameDecl *TND = dyn_cast<TypedefNameDecl>(PrevDecl)) {
12417 if (isa<TypeAliasDecl>(PrevDecl)) Kind = 1;
12420 Diag(PrevDecl->getLocation(), diag::note_previous_decl) << PrevDecl;
12428 Diag(PrevDecl->getLocation(), diag::note_previous_definition);
12441 TagDecl *PrevDecl = nullptr;
12443 PrevDecl = cast<TagDecl>(Previous.getFoundDecl());
12452 // PrevDecl.
12460 cast_or_null<EnumDecl>(PrevDecl), ScopedEnum,
12470 else if (PrevDecl && (Def = cast<EnumDecl>(PrevDecl)->getDefinition())) {
12507 cast_or_null<CXXRecordDecl>(PrevDecl));
12513 cast_or_null<RecordDecl>(PrevDecl));
12617 SetMemberAccessSpecifier(New, PrevDecl, AS);
12626 if (PrevDecl)
12627 New->setAccess(PrevDecl->getAccess());
12651 if (PrevDecl)
12652 mergeDeclAttributes(New, PrevDecl);
12713 /*PrevDecl=*/nullptr,
12934 NamedDecl *PrevDecl = nullptr;
12940 PrevDecl = Previous.getAsSingle<NamedDecl>();
12944 PrevDecl = Previous.getRepresentativeDecl();
12954 if (PrevDecl && PrevDecl->isTemplateParameter()) {
12956 DiagnoseTemplateParameterShadow(D.getIdentifierLoc(), PrevDecl);
12958 PrevDecl = nullptr;
12961 if (PrevDecl && !isDeclInScope(PrevDecl, Record, S))
12962 PrevDecl = nullptr;
12969 TSSL, AS, PrevDecl, &D);
12977 if (NewFD->isInvalidDecl() && PrevDecl) {
12991 /// record, etc. \p PrevDecl should refer to any previous declaration
13004 AccessSpecifier AS, NamedDecl *PrevDecl,
13117 if (PrevDecl && !isa<TagDecl>(PrevDecl)) {
13119 Diag(PrevDecl->getLocation(), diag::note_previous_declaration);
13322 NamedDecl *PrevDecl = LookupSingleName(S, II, Loc, LookupMemberName,
13324 if (PrevDecl && isDeclInScope(PrevDecl, EnclosingContext, S)
13325 && !isa<TagDecl>(PrevDecl)) {
13327 Diag(PrevDecl
14031 NamedDecl *PrevDecl = LookupSingleName(S, II, IILoc, LookupOrdinaryName,
14033 auto *PrevECD = dyn_cast_or_null<EnumConstantDecl>(PrevDecl);
14062 NamedDecl *PrevDecl = LookupSingleName(S, Id, IdLoc, LookupOrdinaryName,
14064 if (PrevDecl && PrevDecl->isTemplateParameter()) {
14066 DiagnoseTemplateParameterShadow(IdLoc, PrevDecl);
14068 PrevDecl = nullptr;
14085 if (PrevDecl) {
14088 assert((getLangOpts().CPlusPlus || !isa<TagDecl>(PrevDecl)) &&
14090 if (!isa<TagDecl>(PrevDecl) && isDeclInScope(PrevDecl, CurContext, S) &&
14091 shouldLinkPossiblyHiddenDecl(PrevDecl, New)) {
14092 if (isa<EnumConstantDecl>(PrevDecl))
14096 Diag(PrevDecl
14715 NamedDecl *PrevDecl = LookupSingleName(TUScope, Name, NameLoc,
14724 if (PrevDecl && (isa<FunctionDecl>(PrevDecl) || isa<VarDecl>(PrevDecl))) {
14725 if (isDeclExternC(PrevDecl))
14726 PrevDecl->addAttr(Attr);
14728 Diag(PrevDecl->getLocation(), diag::warn_redefine_extname_not_applied)
14729 << /*Variable*/(isa<FunctionDecl>(PrevDecl) ? 0 : 1) << PrevDecl;
14738 Decl *PrevDecl = LookupSingleName(TUScope, Name, NameLoc, LookupOrdinaryName);
14740 if (PrevDecl) {
14741 PrevDecl->addAttr(WeakAttr::CreateImplicit(Context, PragmaLoc));
14754 Decl *PrevDecl = LookupSingleName(TUScope, AliasName, AliasNameLoc,
14758 if (PrevDecl && (isa<FunctionDecl>(PrevDecl) || isa<VarDecl>(PrevDecl))) {
14759 if (!PrevDecl->hasAttr<AliasAttr>())
14760 if (NamedDecl *ND = dyn_cast<NamedDecl>(PrevDecl))