Home | History | Annotate | Download | only in Sema

Lines Matching refs:Previous

1015 /// extension, in C when the previous function is already an
1018 static bool AllowOverloadingOfFunction(LookupResult &Previous,
1023 if (Previous.getResultKind() == LookupResult::FoundOverloaded)
1026 return (Previous.getResultKind() == LookupResult::Found
1027 && Previous.getFoundDecl()->hasAttr<OverloadableAttr>());
1593 /// \brief Filter out any previous declarations that the given declaration
1599 LookupResult &previous){
1605 if (previous.empty())
1611 LookupResult::Filter filter = previous.makeFilter();
1662 /// same name and scope as a previous declaration 'Old'. Figure out
2260 /// declarator D which has the same name and scope as a previous
2294 // Determine whether the previous declaration was a definition,
2346 // Inherit the CC from the previous declaration if it was specified
2770 /// scope as a previous declaration 'Old'. Figure out how to merge their types,
2827 /// and scope as a previous declaration 'Old'. Figure out how to resolve this
2834 void Sema::MergeVarDecl(VarDecl *New, LookupResult &Previous) {
2841 if (!Previous.isSingleResult() ||
2842 !(Old = dyn_cast<VarDecl>(Previous.getFoundDecl()))) {
2845 Diag(Previous.getRepresentativeDecl()->getLocation(),
2972 // Keep a chain of previous declarations.
3142 // previous declaration.
4091 LookupResult Previous(*this, NameInfo, LookupOrdinaryName,
4114 Previous.clear(LookupRedeclarationWithLinkage);
4116 LookupName(Previous, S, /* CreateBuiltins = */ IsLinkageLookup);
4118 LookupQualifiedName(Previous, DC);
4128 // enough information to make sure that Previous contains the declaration
4138 // In this case, Previous will point to the overload set
4146 RemoveUsingDecls(Previous);
4149 if (Previous.isSingleResult() &&
4150 Previous.getFoundDecl()->isTemplateParameter()) {
4154 Previous.getFoundDecl());
4156 // Just pretend that we didn't see the previous declaration.
4157 Previous.clear();
4160 // In C++, the previous declaration we find might be a tag type
4164 if (Previous.isSingleTagDecl() &&
4166 Previous.clear();
4182 New = ActOnTypedefDeclarator(S, D, DC, TInfo, Previous);
4184 New = ActOnFunctionDeclarator(S, D, DC, TInfo, Previous,
4188 New = ActOnVariableDeclarator(S, D, DC, TInfo, Previous,
4324 const LookupResult &Previous,
4331 if (!Previous.isSingleResult())
4334 NamedDecl *PrevDecl = Previous.getFoundDecl();
4336 // If there was a previous declaration of this entity, it may be in
4340 // The previous declaration was found on the identifer resolver
4401 TypeSourceInfo *TInfo, LookupResult &Previous) {
4409 Previous.clear();
4435 NamedDecl *ND = ActOnTypedefNameDecl(S, DC, NewTD, Previous, Redeclaration);
4483 LookupResult &Previous, bool &Redeclaration) {
4486 FilterLookupForScope(Previous, DC, S, /*ConsiderLinkage*/ false,
4488 filterNonConflictingPreviousDecls(Context, NewTD, Previous);
4489 if (!Previous.empty()) {
4491 MergeTypedefNameDecl(NewTD, Previous);
4512 /// previous declaration.
4515 /// previous declaration (PrevDecl) that is not in the scope where a
4517 /// declaration occurs in a local scope, previous declarations with
4518 /// linkage may still be considered previous declarations (C99
4521 /// \param PrevDecl the previous declaration found by name
4527 /// \returns true if PrevDecl is an out-of-scope previous declaration
4544 // linkage of the previous declaration.
4556 // previous declarations.
4560 // The previous declaration is in a different namespace, so it
4657 TypeSourceInfo *TInfo, LookupResult &Previous,
4928 CheckShadow(S, NewVD, Previous);
4933 FilterLookupForScope(Previous, DC, S, shouldConsiderLinkage(NewVD),
4937 D.setRedeclaration(CheckVariableDeclaration(NewVD, Previous));
4940 if (!Previous.empty()) {
4941 if (Previous.isSingleResult() &&
4942 isa<FieldDecl>(Previous.getFoundDecl()) &&
4948 Previous.clear();
4952 // No previous declaration in the qualifying scope.
4959 D.setRedeclaration(CheckVariableDeclaration(NewVD, Previous));
4963 CheckMemberSpecialization(NewVD, Previous))
4974 RegisterLocallyScopedExternCDecl(NewVD, Previous, S);
5062 /// \brief Check -Wshadow without the advantage of a previous lookup.
5113 LookupResult &Previous) {
5202 if (Previous.empty() && mayConflictWithNonVisibleExternC(NewVD)) {
5208 Previous.addDecl(Pos->second);
5211 // Filter out any non-conflicting previous declarations.
5212 filterNonConflictingPreviousDecls(Context, NewVD, Previous);
5240 if (!Previous.empty()) {
5241 MergeVarDecl(NewVD, Previous);
5410 /// or performing typo correction if there are no previous declarations with
5416 Sema &SemaRef, LookupResult &Previous, FunctionDecl *NewFD,
5434 "Cannot have an ambiguity in previous-declaration lookup");
5461 Previous.clear();
5462 Previous.setLookupName(Correction.getCorrection());
5469 Previous.addDecl(FD);
5479 NewFD->getTypeSourceInfo(), Previous, ExtraArgs.TemplateParamLists,
5486 Previous.clear();
5487 Previous.setLookupName(Name);
5490 for (LookupResult::iterator Func = Previous.begin(),
5491 FuncEnd = Previous.end();
5764 TypeSourceInfo *TInfo, LookupResult &Previous,
6032 // For now, claim that the objects have no previous declaration.
6094 // Filter out previous declarations that don't match the scope.
6095 FilterLookupForScope(Previous, DC, S, shouldConsiderLinkage(NewFD),
6216 D.setRedeclaration(CheckFunctionDeclaration(S, NewFD, Previous,
6220 else if (!Previous.empty())
6223 Previous.getResultKind() != LookupResult::FoundOverloaded) &&
6224 "previous declaration set still overloaded");
6288 Previous))
6300 Previous))
6322 if (CheckMemberSpecialization(NewFD, Previous))
6336 D.setRedeclaration(CheckFunctionDeclaration(S, NewFD, Previous,
6342 Previous.getResultKind() != LookupResult::FoundOverloaded) &&
6343 "previous declaration set still overloaded");
6391 // Qualified decls generally require a previous declaration.
6423 if (NamedDecl *Result = DiagnoseInvalidRedeclaration(*this, Previous,
6434 if (NamedDecl *Result = DiagnoseInvalidRedeclaration(*this, Previous,
6493 RegisterLocallyScopedExternCDecl(NewFD, Previous, S);
6585 /// an explicit specialization of the previous declaration.
6591 LookupResult &Previous,
6596 // Check for a previous declaration of this name.
6597 if (Previous.empty() && mayConflictWithNonVisibleExternC(NewFD)) {
6603 Previous.addDecl(Pos->second);
6606 // Filter out any non-conflicting previous declarations.
6607 filterNonConflictingPreviousDecls(Context, NewFD, Previous);
6614 if (!Previous.empty()) {
6619 if (!AllowOverloadingOfFunction(Previous, Context)) {
6621 OldDecl = Previous.getFoundDecl();
6623 switch (CheckOverload(S, NewFD, Previous, OldDecl,
6646 else if (!Previous.empty())
6647 OverloadedDecl = Previous.getRepresentativeDecl();
6691 Previous.clear();
6692 Previous.addDecl(OldDecl);
6721 // because of templates, which means that the previous
6824 if (NewFD->isExternC() && Previous.empty()) {
7896 // Find a previous declaration that's not a definition.
8213 // Just pretend that we didn't see the previous declaration.
8487 // Don't complain if we're in GNU89 mode and the previous definition
8541 // Warn if a global function is defined without a previous
9150 /// Check whether this is a valid redeclaration of a previous enumeration.
9211 bool Sema::isAcceptableTagRedeclaration(const TagDecl *Previous,
9228 TagTypeKind OldTag = Previous->getTagKind();
9236 if (const CXXRecordDecl *Record = dyn_cast<CXXRecordDecl>(Previous))
9249 // On definitions, check previous tags and issue a fix-it for each
9251 if (Previous->getDefinition()) {
9257 for (TagDecl::redecl_iterator I(Previous->redecls_begin()),
9258 E(Previous->redecls_end()); I != E; ++I) {
9275 // Check for a previous definition. If current tag and definition
9277 // with previous tag type, give a warning, but no fix-it.
9278 const TagDecl *Redecl = Previous->getDefinition() ?
9279 Previous->getDefinition() : Previous;
9289 // If there is a previous defintion, suggest a fix-it.
9290 if (Previous->getDefinition()) {
9404 LookupResult Previous(*this, Name, NameLoc, LookupTagName, Redecl);
9437 LookupQualifiedName(Previous, DC);
9439 if (Previous.isAmbiguous())
9442 if (Previous.empty()) {
9449 if (Previous.wasNotFoundInCurrentInstantiation() &&
9463 // If this is a named struct, check to see if there was a previous forward
9468 LookupName(Previous, S);
9470 if (Previous.isAmbiguous() &&
9472 LookupResult::Filter F = Previous.makeFilter();
9482 if (Previous.isAmbiguous())
9500 if (Previous.isSingleResult() &&
9501 Previous.getFoundDecl()->isTemplateParameter()) {
9503 DiagnoseTemplateParameterShadow(NameLoc, Previous.getFoundDecl());
9504 // Just pretend that we didn't see the previous declaration.
9505 Previous.clear();
9513 if (Previous.empty() && StdBadAlloc) {
9515 // name lookup). Fill in this implicit declaration as the previous
9517 Previous.addDecl(getStdBadAlloc());
9521 // If we didn't find a previous declaration, and this is a reference
9525 if (Name && Previous.empty() &&
9582 Previous.setRedeclarationKind(ForRedeclaration);
9583 LookupQualifiedName(Previous, SearchDC);
9587 if (!Previous.empty()) {
9588 NamedDecl *PrevDecl = (*Previous.begin())->getUnderlyingDecl();
9607 Previous.clear();
9608 Previous.addDecl(Tag);
9609 Previous.resolveKind();
9616 // If this is a use of a previous tag, or if the tag is already declared
9643 Previous.clear();
9667 // All conflicts with previous declarations are recovered by
9668 // returning the previous declaration, unless this is a definition,
9689 // If we're defining a specialization and the previous definition
9714 // references get the previous definition.
9716 Previous.clear();
9729 Previous.clear();
9746 Previous.clear();
9761 !Previous.isForRedeclaration()) {
9806 // new scope, so clear out the previous declaration.
9807 Previous.clear();
9814 if (Previous.isSingleResult())
9815 PrevDecl = cast<TagDecl>(Previous.getFoundDecl());
9822 // Otherwise, create a new declaration. If there is a previous
9941 if (isExplicitSpecialization && CheckMemberSpecialization(New, Previous))
9964 New->setObjectOfFriendDecl(/* PreviouslyDeclared = */ !Previous.empty() ||
10272 LookupResult Previous(*this, II, Loc, LookupMemberName, ForRedeclaration);
10273 LookupName(Previous, S);
10274 switch (Previous.getResultKind()) {
10277 PrevDecl = Previous.getAsSingle<NamedDecl>();
10281 PrevDecl = Previous.getRepresentativeDecl();
10289 Previous.suppressDiagnostics();
10294 // Just pretend that we didn't see the previous declaration.
10328 /// record, etc. \p PrevDecl should refer to any previous declaration
11302 // Just pretend that we didn't see the previous declaration.
11415 // a previous element has already been set to.
11446 // Null EnumConstantDecl means a previous diagnostic has been emitted for