Home | History | Annotate | Download | only in Sema

Lines Matching refs:Previous

908 /// extension, in C when the previous function is already an
911 static bool AllowOverloadingOfFunction(LookupResult &Previous,
916 if (Previous.getResultKind() == LookupResult::FoundOverloaded)
919 return (Previous.getResultKind() == LookupResult::Found
920 && Previous.getFoundDecl()->hasAttr<OverloadableAttr>());
1471 /// same name and scope as a previous declaration 'Old'. Figure out
1728 /// declarator D which has the same name and scope as a previous
1762 // Determine whether the previous declaration was a definition,
2163 /// scope as a previous declaration 'Old'. Figure out how to merge their types,
2222 /// and scope as a previous declaration 'Old'. Figure out how to resolve this
2229 void Sema::MergeVarDecl(VarDecl *New, LookupResult &Previous) {
2236 if (!Previous.isSingleResult() ||
2237 !(Old = dyn_cast<VarDecl>(Previous.getFoundDecl()))) {
2240 Diag(Previous.getRepresentativeDecl()->getLocation(),
2356 // Keep a chain of previous declarations.
3437 LookupResult Previous(*this, NameInfo, LookupOrdinaryName,
3460 Previous.clear(LookupRedeclarationWithLinkage);
3462 LookupName(Previous, S, /* CreateBuiltins = */ IsLinkageLookup);
3464 LookupQualifiedName(Previous, DC);
3474 // enough information to make sure that Previous contains the declaration
3484 // In this case, Previous will point to the overload set
3492 RemoveUsingDecls(Previous);
3495 if (Previous.isSingleResult() &&
3496 Previous.getFoundDecl()->isTemplateParameter()) {
3500 Previous.getFoundDecl());
3502 // Just pretend that we didn't see the previous declaration.
3503 Previous.clear();
3506 // In C++, the previous declaration we find might be a tag type
3510 if (Previous.isSingleTagDecl() &&
3512 Previous.clear();
3521 New = ActOnTypedefDeclarator(S, D, DC, TInfo, Previous);
3523 New = ActOnFunctionDeclarator(S, D, DC, TInfo, Previous,
3527 New = ActOnVariableDeclarator(S, D, DC, TInfo, Previous,
3617 const LookupResult &Previous,
3624 if (!Previous.isSingleResult())
3627 NamedDecl *PrevDecl = Previous.getFoundDecl();
3629 // If there was a previous declaration of this variable, it may be
3633 // The previous declaration was found on the identifer resolver
3690 TypeSourceInfo *TInfo, LookupResult &Previous) {
3698 Previous.clear();
3729 NamedDecl *ND = ActOnTypedefNameDecl(S, DC, NewTD, Previous, Redeclaration);
3775 LookupResult &Previous, bool &Redeclaration) {
3778 FilterLookupForScope(Previous, DC, S, /*ConsiderLinkage*/ false,
3780 if (!Previous.empty()) {
3782 MergeTypedefNameDecl(NewTD, Previous);
3805 /// previous declaration.
3808 /// previous declaration (PrevDecl) that is not in the scope where a
3810 /// declaration occurs in a local scope, previous declarations with
3811 /// linkage may still be considered previous declarations (C99
3814 /// \param PrevDecl the previous declaration found by name
3820 /// \returns true if PrevDecl is an out-of-scope previous declaration
3837 // linkage of the previous declaration.
3849 // previous declarations.
3853 // The previous declaration is in a different namespace, so it
3914 TypeSourceInfo *TInfo, LookupResult &Previous,
4138 CheckShadow(S, NewVD, Previous);
4143 FilterLookupForScope(Previous, DC, S, NewVD->hasLinkage(),
4147 D.setRedeclaration(CheckVariableDeclaration(NewVD, Previous));
4150 if (!Previous.empty()) {
4151 if (Previous.isSingleResult() &&
4152 isa<FieldDecl>(Previous.getFoundDecl()) &&
4158 Previous.clear();
4162 // No previous declaration in the qualifying scope.
4169 D.setRedeclaration(CheckVariableDeclaration(NewVD, Previous));
4173 CheckMemberSpecialization(NewVD, Previous))
4180 if (Previous.isSingleResult()) {
4181 VarDecl *Def = dyn_cast<VarDecl>(Previous.getFoundDecl());
4193 RegisterLocallyScopedExternCDecl(NewVD, Previous, S);
4288 /// \brief Check -Wshadow without the advantage of a previous lookup.
4313 LookupResult &Previous) {
4390 if (Previous.empty() && NewVD->isExternC()) {
4397 Previous.addDecl(Pos->second);
4426 if (!Previous.empty()) {
4427 MergeVarDecl(NewVD, Previous);
4548 /// or performing typo correction if there are no previous declarations with
4554 Sema &SemaRef, LookupResult &Previous, FunctionDecl *NewFD,
4572 "Cannot have an ambiguity in previous-declaration lookup");
4598 Previous.clear();
4599 Previous.setLookupName(Correction.getCorrection());
4606 Previous.addDecl(FD);
4616 NewFD->getTypeSourceInfo(), Previous, ExtraArgs.TemplateParamLists,
4623 Previous.clear();
4624 Previous.setLookupName(Name);
4627 for (LookupResult::iterator Func = Previous.begin(),
4628 FuncEnd = Previous.end();
4877 TypeSourceInfo *TInfo, LookupResult &Previous,
5180 // For now, claim that the objects have no previous declaration.
5227 // Filter out previous declarations that don't match the scope.
5228 FilterLookupForScope(Previous, DC, S, NewFD->hasLinkage(),
5342 D.setRedeclaration(CheckFunctionDeclaration(S, NewFD, Previous,
5346 Previous.getResultKind() != LookupResult::FoundOverloaded) &&
5347 "previous declaration set still overloaded");
5415 Previous))
5427 Previous))
5449 if (CheckMemberSpecialization(NewFD, Previous))
5463 D.setRedeclaration(CheckFunctionDeclaration(S, NewFD, Previous,
5469 Previous.getResultKind() != LookupResult::FoundOverloaded) &&
5470 "previous declaration set still overloaded");
5518 // Qualified decls generally require a previous declaration.
5550 if (NamedDecl *Result = DiagnoseInvalidRedeclaration(*this, Previous,
5561 if (NamedDecl *Result = DiagnoseInvalidRedeclaration(*this, Previous,
5594 if (D.isRedeclaration() && Previous.isSingleResult()) {
5596 FunctionDecl *PrevFD = dyn_cast<FunctionDecl>(Previous.getFoundDecl());
5634 RegisterLocallyScopedExternCDecl(NewFD, Previous, S);
5687 /// an explicit specialization of the previous declaration.
5693 LookupResult &Previous,
5698 // Check for a previous declaration of this name.
5699 if (Previous.empty() && NewFD->isExternC()) {
5706 Previous.addDecl(Pos->second);
5713 if (!Previous.empty()) {
5720 if (!AllowOverloadingOfFunction(Previous, Context)) {
5722 OldDecl = Previous.getFoundDecl();
5724 switch (CheckOverload(S, NewFD, Previous, OldDecl,
5747 else if (!Previous.empty())
5748 OverloadedDecl = Previous.getRepresentativeDecl();
5765 Previous.clear();
5766 Previous.addDecl(OldDecl);
6980 // Just pretend that we didn't see the previous declaration.
7244 // Don't complain if we're in GNU89 mode and the previous definition
7297 // Warn if a global function is defined without a previous
7821 /// Check whether this is a valid redeclaration of a previous enumeration.
7859 bool Sema::isAcceptableTagRedeclaration(const TagDecl *Previous,
7876 TagTypeKind OldTag = Previous->getTagKind();
7885 if (const CXXRecordDecl *Record = dyn_cast<CXXRecordDecl>(Previous))
7897 // On definitions, check previous tags and issue a fix-it for each
7899 Previous->getDefinition()) {
7905 for (TagDecl::redecl_iterator I(Previous->redecls_begin()),
7906 E(Previous->redecls_end()); I != E; ++I) {
7923 // Check for a previous definition. If current tag and definition
7925 // with previous tag type, give a warning, but no fix-it.
7926 const TagDecl *Redecl = Previous->getDefinition() ?
7927 Previous->getDefinition() : Previous;
7937 // If there is a previous defintion, suggest a fix-it.
7938 if (Previous->getDefinition()) {
8052 LookupResult Previous(*this, Name, NameLoc, LookupTagName, Redecl);
8085 LookupQualifiedName(Previous, DC);
8087 if (Previous.isAmbiguous())
8090 if (Previous.empty()) {
8097 if (Previous.wasNotFoundInCurrentInstantiation() &&
8111 // If this is a named struct, check to see if there was a previous forward
8116 LookupName(Previous, S);
8118 if (Previous.isAmbiguous() &&
8120 LookupResult::Filter F = Previous.makeFilter();
8130 if (Previous.isAmbiguous())
8148 if (Previous.isSingleResult() &&
8149 Previous.getFoundDecl()->isTemplateParameter()) {
8151 DiagnoseTemplateParameterShadow(NameLoc, Previous.getFoundDecl());
8152 // Just pretend that we didn't see the previous declaration.
8153 Previous.clear();
8161 if (Previous.empty() && StdBadAlloc) {
8163 // name lookup). Fill in this implicit declaration as the previous
8165 Previous.addDecl(getStdBadAlloc());
8169 // If we didn't find a previous declaration, and this is a reference
8173 if (Name && Previous.empty() &&
8230 Previous.setRedeclarationKind(ForRedeclaration);
8231 LookupQualifiedName(Previous, SearchDC);
8235 if (!Previous.empty()) {
8236 NamedDecl *PrevDecl = (*Previous.begin())->getUnderlyingDecl();
8255 Previous.clear();
8256 Previous.addDecl(Tag);
8257 Previous.resolveKind();
8264 // If this is a use of a previous tag, or if the tag is already declared
8291 Previous.clear();
8315 // All conflicts with previous declarations are recovered by
8316 // returning the previous declaration, unless this is a definition,
8337 // If we're defining a specialization and the previous definition
8362 // references get the previous definition.
8364 Previous.clear();
8377 Previous.clear();
8394 Previous.clear();
8409 !Previous.isForRedeclaration()) {
8454 // new scope, so clear out the previous declaration.
8455 Previous.clear();
8462 if (Previous.isSingleResult())
8463 PrevDecl = cast<TagDecl>(Previous.getFoundDecl());
8470 // Otherwise, create a new declaration. If there is a previous
8588 if (isExplicitSpecialization && CheckMemberSpecialization(New, Previous))
8611 New->setObjectOfFriendDecl(/* PreviouslyDeclared = */ !Previous.empty() ||
8889 LookupResult Previous(*this, II, Loc, LookupMemberName, ForRedeclaration);
8890 LookupName(Previous, S);
8891 switch (Previous.getResultKind()) {
8894 PrevDecl = Previous.getAsSingle<NamedDecl>();
8898 PrevDecl = Previous.getRepresentativeDecl();
8906 Previous.suppressDiagnostics();
8911 // Just pretend that we didn't see the previous declaration.
8945 /// record, etc. \p PrevDecl should refer to any previous declaration
10105 // Just pretend that we didn't see the previous declaration.