Lines Matching refs:Previous
1174 static bool AllowOverloadingOfFunction(LookupResult &Previous, in AllowOverloadingOfFunction() argument
1179 if (Previous.getResultKind() == LookupResult::FoundOverloaded) in AllowOverloadingOfFunction()
1182 return (Previous.getResultKind() == LookupResult::Found in AllowOverloadingOfFunction()
1183 && Previous.getFoundDecl()->hasAttr<OverloadableAttr>()); in AllowOverloadingOfFunction()
1820 LookupResult &Previous) { in filterNonConflictingPreviousTypedefDecls() argument
1826 if (Previous.empty()) in filterNonConflictingPreviousTypedefDecls()
1829 LookupResult::Filter Filter = Previous.makeFilter(); in filterNonConflictingPreviousTypedefDecls()
3218 LookupResult &Previous) { in mergeTypeWithPrevious() argument
3227 if (Previous.isShadowed()) in mergeTypeWithPrevious()
3254 void Sema::MergeVarDecl(VarDecl *New, LookupResult &Previous) { in MergeVarDecl() argument
3264 if (Previous.isSingleResult()) { in MergeVarDecl()
3266 OldTemplate = dyn_cast<VarTemplateDecl>(Previous.getFoundDecl()); in MergeVarDecl()
3269 Old = dyn_cast<VarDecl>(Previous.getFoundDecl()); in MergeVarDecl()
3274 Diag(Previous.getRepresentativeDecl()->getLocation(), in MergeVarDecl()
3316 mergeTypeWithPrevious(*this, New, MostRecent, Previous)); in MergeVarDecl()
3321 MergeVarDeclTypes(New, Old, mergeTypeWithPrevious(*this, New, Old, Previous)); in MergeVarDecl()
4697 LookupResult Previous(*this, NameInfo, LookupOrdinaryName, in HandleDeclarator() local
4725 Previous.clear(LookupRedeclarationWithLinkage); in HandleDeclarator()
4727 LookupName(Previous, S, CreateBuiltins); in HandleDeclarator()
4729 LookupQualifiedName(Previous, DC); in HandleDeclarator()
4757 RemoveUsingDecls(Previous); in HandleDeclarator()
4760 if (Previous.isSingleResult() && in HandleDeclarator()
4761 Previous.getFoundDecl()->isTemplateParameter()) { in HandleDeclarator()
4765 Previous.getFoundDecl()); in HandleDeclarator()
4768 Previous.clear(); in HandleDeclarator()
4775 if (Previous.isSingleTagDecl() && in HandleDeclarator()
4777 Previous.clear(); in HandleDeclarator()
4793 New = ActOnTypedefDeclarator(S, D, DC, TInfo, Previous); in HandleDeclarator()
4795 New = ActOnFunctionDeclarator(S, D, DC, TInfo, Previous, in HandleDeclarator()
4799 New = ActOnVariableDeclarator(S, D, DC, TInfo, Previous, TemplateParamLists, in HandleDeclarator()
4983 TypeSourceInfo *TInfo, LookupResult &Previous) { in ActOnTypedefDeclarator() argument
4991 Previous.clear(); in ActOnTypedefDeclarator()
5015 NamedDecl *ND = ActOnTypedefNameDecl(S, DC, NewTD, Previous, Redeclaration); in ActOnTypedefDeclarator()
5063 LookupResult &Previous, bool &Redeclaration) { in ActOnTypedefNameDecl() argument
5066 FilterLookupForScope(Previous, DC, S, /*ConsiderLinkage*/false, in ActOnTypedefNameDecl()
5068 filterNonConflictingPreviousTypedefDecls(Context, NewTD, Previous); in ActOnTypedefNameDecl()
5069 if (!Previous.empty()) { in ActOnTypedefNameDecl()
5071 MergeTypedefNameDecl(NewTD, Previous); in ActOnTypedefNameDecl()
5466 TypeSourceInfo *TInfo, LookupResult &Previous, in ActOnVariableDeclarator() argument
5885 CheckShadow(S, NewVD, Previous); in ActOnVariableDeclarator()
5890 FilterLookupForScope(Previous, OriginalDC, S, shouldConsiderLinkage(NewVD), in ActOnVariableDeclarator()
5900 Previous.isSingleResult() && !Previous.isShadowed() && in ActOnVariableDeclarator()
5901 isDeclInScope(Previous.getFoundDecl(), OriginalDC, S, false)); in ActOnVariableDeclarator()
5904 D.setRedeclaration(CheckVariableDeclaration(NewVD, Previous)); in ActOnVariableDeclarator()
5908 CheckMemberSpecialization(NewVD, Previous)) in ActOnVariableDeclarator()
5912 if (!Previous.empty()) { in ActOnVariableDeclarator()
5913 if (Previous.isSingleResult() && in ActOnVariableDeclarator()
5914 isa<FieldDecl>(Previous.getFoundDecl()) && in ActOnVariableDeclarator()
5920 Previous.clear(); in ActOnVariableDeclarator()
5932 D.setRedeclaration(CheckVariableDeclaration(NewVD, Previous)); in ActOnVariableDeclarator()
5980 if (D.isRedeclaration() && !Previous.empty()) { in ActOnVariableDeclarator()
5982 *this, dyn_cast<NamedDecl>(Previous.getRepresentativeDecl()), NewVD, in ActOnVariableDeclarator()
6093 Sema &S, const T *ND, bool IsGlobal, LookupResult &Previous) { in checkGlobalOrExternCConflict() argument
6107 Previous.clear(); in checkGlobalOrExternCConflict()
6108 Previous.addDecl(Prev); in checkGlobalOrExternCConflict()
6123 for (LookupResult::iterator I = Previous.begin(), E = Previous.end(); in checkGlobalOrExternCConflict()
6176 LookupResult &Previous) { in checkForConflictWithNonVisibleExternC() argument
6183 Previous.clear(); in checkForConflictWithNonVisibleExternC()
6184 Previous.addDecl(Prev); in checkForConflictWithNonVisibleExternC()
6194 return checkGlobalOrExternCConflict(S, ND, /*IsGlobal*/true, Previous); in checkForConflictWithNonVisibleExternC()
6200 return checkGlobalOrExternCConflict(S, ND, /*IsGlobal*/false, Previous); in checkForConflictWithNonVisibleExternC()
6355 bool Sema::CheckVariableDeclaration(VarDecl *NewVD, LookupResult &Previous) { in CheckVariableDeclaration() argument
6364 if (Previous.empty() && in CheckVariableDeclaration()
6365 checkForConflictWithNonVisibleExternC(*this, NewVD, Previous)) in CheckVariableDeclaration()
6366 Previous.setShadowed(); in CheckVariableDeclaration()
6369 filterNonConflictingPreviousDecls(Context, NewVD, Previous); in CheckVariableDeclaration()
6371 if (!Previous.empty()) { in CheckVariableDeclaration()
6372 MergeVarDecl(NewVD, Previous); in CheckVariableDeclaration()
6546 Sema &SemaRef, LookupResult &Previous, FunctionDecl *NewFD, in DiagnoseInvalidRedeclaration() argument
6592 Previous.clear(); in DiagnoseInvalidRedeclaration()
6593 Previous.setLookupName(Correction.getCorrection()); in DiagnoseInvalidRedeclaration()
6600 Previous.addDecl(FD); in DiagnoseInvalidRedeclaration()
6618 NewFD->getTypeSourceInfo(), Previous, ExtraArgs.TemplateParamLists, in DiagnoseInvalidRedeclaration()
6628 for (LookupResult::iterator I = Previous.begin(), E = Previous.end(); in DiagnoseInvalidRedeclaration()
6646 Previous.clear(); in DiagnoseInvalidRedeclaration()
6647 Previous.setLookupName(Name); in DiagnoseInvalidRedeclaration()
7044 TypeSourceInfo *TInfo, LookupResult &Previous, in ActOnFunctionDeclarator() argument
7385 FilterLookupForScope(Previous, OriginalDC, S, shouldConsiderLinkage(NewFD), in ActOnFunctionDeclarator()
7515 D.setRedeclaration(CheckFunctionDeclaration(S, NewFD, Previous, in ActOnFunctionDeclarator()
7517 else if (!Previous.empty()) in ActOnFunctionDeclarator()
7521 Previous.getResultKind() != LookupResult::FoundOverloaded) && in ActOnFunctionDeclarator()
7607 Previous)) in ActOnFunctionDeclarator()
7620 Previous)) in ActOnFunctionDeclarator()
7644 if (CheckMemberSpecialization(NewFD, Previous)) in ActOnFunctionDeclarator()
7657 D.setRedeclaration(CheckFunctionDeclaration(S, NewFD, Previous, in ActOnFunctionDeclarator()
7659 else if (!Previous.empty()) in ActOnFunctionDeclarator()
7665 Previous.getResultKind() != LookupResult::FoundOverloaded) && in ActOnFunctionDeclarator()
7746 *this, Previous, NewFD, ExtraArgs, false, nullptr)) { in ActOnFunctionDeclarator()
7756 *this, Previous, NewFD, ExtraArgs, true, S)) { in ActOnFunctionDeclarator()
7823 if (D.isRedeclaration() && !Previous.empty()) { in ActOnFunctionDeclarator()
7825 *this, dyn_cast<NamedDecl>(Previous.getRepresentativeDecl()), NewFD, in ActOnFunctionDeclarator()
7906 LookupResult &Previous, in CheckFunctionDeclaration() argument
7915 !Previous.isShadowed(); in CheckFunctionDeclaration()
7918 filterNonConflictingPreviousDecls(Context, NewFD, Previous); in CheckFunctionDeclaration()
7925 if (!Previous.empty()) { in CheckFunctionDeclaration()
7930 if (!AllowOverloadingOfFunction(Previous, Context)) { in CheckFunctionDeclaration()
7931 NamedDecl *Candidate = Previous.getFoundDecl(); in CheckFunctionDeclaration()
7937 switch (CheckOverload(S, NewFD, Previous, OldDecl, in CheckFunctionDeclaration()
7960 else if (!Previous.empty()) in CheckFunctionDeclaration()
7961 OverloadedDecl = Previous.getRepresentativeDecl(); in CheckFunctionDeclaration()
7972 checkForConflictWithNonVisibleExternC(*this, NewFD, Previous)) { in CheckFunctionDeclaration()
7973 filterNonConflictingPreviousDecls(Context, NewFD, Previous); in CheckFunctionDeclaration()
7974 if (!Previous.empty()) { in CheckFunctionDeclaration()
7978 OldDecl = Previous.getFoundDecl(); in CheckFunctionDeclaration()
7986 Diag(Previous.getFoundDecl()->getLocation(), in CheckFunctionDeclaration()
8044 Previous.clear(); in CheckFunctionDeclaration()
8045 Previous.addDecl(OldDecl); in CheckFunctionDeclaration()
8158 if (Previous.empty() && NewFD->isExternC()) { in CheckFunctionDeclaration()
11132 bool Sema::isAcceptableTagRedeclaration(const TagDecl *Previous, in isAcceptableTagRedeclaration() argument
11149 TagTypeKind OldTag = Previous->getTagKind(); in isAcceptableTagRedeclaration()
11157 if (const CXXRecordDecl *Record = dyn_cast<CXXRecordDecl>(Previous)) in isAcceptableTagRedeclaration()
11172 if (Previous->getDefinition()) { in isAcceptableTagRedeclaration()
11178 for (auto I : Previous->redecls()) { in isAcceptableTagRedeclaration()
11198 const TagDecl *Redecl = Previous->getDefinition() ? in isAcceptableTagRedeclaration()
11199 Previous->getDefinition() : Previous; in isAcceptableTagRedeclaration()
11210 if (Previous->getDefinition()) { in isAcceptableTagRedeclaration()
11378 LookupResult Previous(*this, Name, NameLoc, LookupTagName, Redecl); in ActOnTag() local
11410 LookupQualifiedName(Previous, DC); in ActOnTag()
11412 if (Previous.isAmbiguous()) in ActOnTag()
11415 if (Previous.empty()) { in ActOnTag()
11422 if (Previous.wasNotFoundInCurrentInstantiation() && in ActOnTag()
11441 LookupName(Previous, S); in ActOnTag()
11445 if (Previous.isAmbiguous() && in ActOnTag()
11447 LookupResult::Filter F = Previous.makeFilter(); in ActOnTag()
11469 if (!Previous.empty() && TUK == TUK_Friend) { in ActOnTag()
11471 LookupResult::Filter F = Previous.makeFilter(); in ActOnTag()
11488 if (Previous.isSingleResult() && FriendSawTagOutsideEnclosingNamespace) { in ActOnTag()
11489 NamedDecl *ND = Previous.getFoundDecl(); in ActOnTag()
11496 if (Previous.isAmbiguous()) in ActOnTag()
11509 if (Previous.isSingleResult() && in ActOnTag()
11510 Previous.getFoundDecl()->isTemplateParameter()) { in ActOnTag()
11512 DiagnoseTemplateParameterShadow(NameLoc, Previous.getFoundDecl()); in ActOnTag()
11514 Previous.clear(); in ActOnTag()
11522 if (Previous.empty() && StdBadAlloc) { in ActOnTag()
11526 Previous.addDecl(getStdBadAlloc()); in ActOnTag()
11534 if (Name && Previous.empty() && in ActOnTag()
11590 Previous.setRedeclarationKind(ForRedeclaration); in ActOnTag()
11591 LookupQualifiedName(Previous, SearchDC); in ActOnTag()
11595 if (!Previous.empty()) { in ActOnTag()
11596 NamedDecl *PrevDecl = Previous.getFoundDecl(); in ActOnTag()
11598 getLangOpts().MSVCCompat ? *Previous.begin() : PrevDecl; in ActOnTag()
11617 Previous.clear(); in ActOnTag()
11618 Previous.addDecl(Tag); in ActOnTag()
11619 Previous.resolveKind(); in ActOnTag()
11654 Previous.clear(); in ActOnTag()
11753 Previous.clear(); in ActOnTag()
11765 Previous.clear(); in ActOnTag()
11790 Previous.clear(); in ActOnTag()
11805 !Previous.isForRedeclaration()) { in ActOnTag()
11851 Previous.clear(); in ActOnTag()
11858 if (Previous.isSingleResult()) in ActOnTag()
11859 PrevDecl = cast<TagDecl>(Previous.getFoundDecl()); in ActOnTag()
11994 if (isExplicitSpecialization && CheckMemberSpecialization(New, Previous)) in ActOnTag()
12338 LookupResult Previous(*this, II, Loc, LookupMemberName, ForRedeclaration); in HandleField() local
12339 LookupName(Previous, S); in HandleField()
12340 switch (Previous.getResultKind()) { in HandleField()
12343 PrevDecl = Previous.getAsSingle<NamedDecl>(); in HandleField()
12347 PrevDecl = Previous.getRepresentativeDecl(); in HandleField()
12355 Previous.suppressDiagnostics(); in HandleField()