clang API Documentation
Represents the results of name lookup. More...
#include <Lookup.h>
Classes | |
| class | Filter |
Public Types | |
| enum | LookupResultKind { NotFound = 0, NotFoundInCurrentInstantiation, Found, FoundOverloaded, FoundUnresolvedValue, Ambiguous } |
| enum | AmbiguityKind { AmbiguousBaseSubobjectTypes, AmbiguousBaseSubobjects, AmbiguousReference, AmbiguousTagHiding } |
| enum | TemporaryToken { Temporary } |
| A little identifier for flagging temporary lookup results. More... | |
| typedef UnresolvedSetImpl::iterator | iterator |
Public Member Functions | |
| LookupResult (Sema &SemaRef, const DeclarationNameInfo &NameInfo, Sema::LookupNameKind LookupKind, Sema::RedeclarationKind Redecl=Sema::NotForRedeclaration) | |
| LookupResult (Sema &SemaRef, DeclarationName Name, SourceLocation NameLoc, Sema::LookupNameKind LookupKind, Sema::RedeclarationKind Redecl=Sema::NotForRedeclaration) | |
| LookupResult (TemporaryToken _, const LookupResult &Other) | |
| ~LookupResult () | |
| const DeclarationNameInfo & | getLookupNameInfo () const |
| Gets the name info to look up. | |
| void | setLookupNameInfo (const DeclarationNameInfo &NameInfo) |
| Sets the name info to look up. | |
| DeclarationName | getLookupName () const |
| Gets the name to look up. | |
| void | setLookupName (DeclarationName Name) |
| Sets the name to look up. | |
| Sema::LookupNameKind | getLookupKind () const |
| Gets the kind of lookup to perform. | |
| bool | isForRedeclaration () const |
| True if this lookup is just looking for an existing declaration. | |
| bool | isHiddenDeclarationVisible () const |
| Determine whether this lookup is permitted to see hidden declarations, such as those in modules that have not yet been imported. | |
| void | setHideTags (bool Hide) |
| bool | isAmbiguous () const |
| bool | isSingleResult () const |
| bool | isOverloadedResult () const |
| Determines if the results are overloaded. | |
| bool | isUnresolvableResult () const |
| LookupResultKind | getResultKind () const |
| AmbiguityKind | getAmbiguityKind () const |
| const UnresolvedSetImpl & | asUnresolvedSet () const |
| iterator | begin () const |
| iterator | end () const |
| bool | empty () const |
| Return true if no decls were found. | |
| CXXBasePaths * | getBasePaths () const |
| Return the base paths structure that's associated with these results, or null if none is. | |
| NamedDecl * | getAcceptableDecl (NamedDecl *D) const |
| Retrieve the accepted (re)declaration of the given declaration, if there is one. | |
| unsigned | getIdentifierNamespace () const |
| Returns the identifier namespace mask for this lookup. | |
| bool | isClassLookup () const |
| Returns whether these results arose from performing a lookup into a class. | |
| CXXRecordDecl * | getNamingClass () const |
| Returns the 'naming class' for this lookup, i.e. the class which was looked into to find these results. | |
| void | setNamingClass (CXXRecordDecl *Record) |
| Sets the 'naming class' for this lookup. | |
| QualType | getBaseObjectType () const |
| Returns the base object type associated with this lookup; important for [class.protected]. Most lookups do not have an associated base object. | |
| void | setBaseObjectType (QualType T) |
| Sets the base object type for this lookup. | |
| void | addDecl (NamedDecl *D) |
| Add a declaration to these results with its natural access. Does not test the acceptance criteria. | |
| void | addDecl (NamedDecl *D, AccessSpecifier AS) |
| Add a declaration to these results with the given access. Does not test the acceptance criteria. | |
| void | addAllDecls (const LookupResult &Other) |
| Add all the declarations from another set of lookup results. | |
| bool | wasNotFoundInCurrentInstantiation () const |
| Determine whether no result was found because we could not search into dependent base classes of the current instantiation. | |
| void | setNotFoundInCurrentInstantiation () |
| Note that while no result was found in the current instantiation, there were dependent base classes that could not be searched. | |
| void | resolveKind () |
| Resolves the result kind of the lookup, possibly hiding decls. | |
| void | resolveKindAfterFilter () |
| Re-resolves the result kind of the lookup after a set of removals has been performed. | |
| template<class DeclClass > | |
| DeclClass * | getAsSingle () const |
| NamedDecl * | getFoundDecl () const |
| Fetch the unique decl found by this lookup. Asserts that one was found. | |
| NamedDecl * | getRepresentativeDecl () const |
| Fetches a representative decl. Useful for lazy diagnostics. | |
| bool | isSingleTagDecl () const |
| Asks if the result is a single tag decl. | |
| void | setAmbiguousBaseSubobjectTypes (CXXBasePaths &P) |
| Make these results show that the name was found in base classes of different types. | |
| void | setAmbiguousBaseSubobjects (CXXBasePaths &P) |
| Make these results show that the name was found in distinct base classes of the same type. | |
| void | setAmbiguousQualifiedTagHiding () |
| Make these results show that the name was found in different contexts and a tag decl was hidden by an ordinary decl in a different context. | |
| void | clear () |
| Clears out any current state. | |
| void | clear (Sema::LookupNameKind Kind) |
| Clears out any current state and re-initializes for a different kind of lookup. | |
| void | setRedeclarationKind (Sema::RedeclarationKind RK) |
| Change this lookup's redeclaration kind. | |
| void | print (raw_ostream &) |
| void | suppressDiagnostics () |
| bool | isSuppressingDiagnostics () const |
| Determines whether this lookup is suppressing diagnostics. | |
| void | setContextRange (SourceRange SR) |
| Sets a 'context' source range. | |
| SourceRange | getContextRange () const |
| SourceLocation | getNameLoc () const |
| Sema & | getSema () const |
| Get the Sema object that this lookup result is searching with. | |
| Filter | makeFilter () |
| Create a filter for this result set. | |
Static Public Member Functions | |
| static bool | isVisible (NamedDecl *D) |
| Determine whether the given declaration is visible to the program. | |
Represents the results of name lookup.
An instance of the LookupResult class captures the results of a single name lookup, which can return no result (nothing found), a single declaration, a set of overloaded functions, or an ambiguity. Use the getKind() method to determine which of these results occurred for a given lookup.
| AmbiguousBaseSubobjectTypes |
Name lookup results in an ambiguity because multiple entities that meet the lookup criteria were found in subobjects of different types. For example: |
| AmbiguousBaseSubobjects |
Name lookup results in an ambiguity because multiple nonstatic entities that meet the lookup criteria were found in different subobjects of the same type. For example: |
| AmbiguousReference |
Name lookup results in an ambiguity because multiple definitions of entity that meet the lookup criteria were found in different declaration contexts. namespace A { int i; namespace B { int i; } int test() { using namespace B; return i; // error 'i' is found in namespace A and A::B } } |
| AmbiguousTagHiding |
Name lookup results in an ambiguity because an entity with a tag name was hidden by an entity with an ordinary name from a different context. |
| NotFound |
No entity found met the criteria. |
| NotFoundInCurrentInstantiation |
No entity found met the criteria within the current instantiation,, but there were dependent base classes of the current instantiation that could not be searched. |
| Found |
Name lookup found a single declaration that met the criteria. getFoundDecl() will return this declaration. |
| FoundOverloaded |
Name lookup found a set of overloaded functions that met the criteria. |
| FoundUnresolvedValue |
Name lookup found an unresolvable value declaration and cannot yet complete. This only happens in C++ dependent contexts with dependent using declarations. |
| Ambiguous |
Name lookup results in an ambiguity; use getAmbiguityKind to figure out what kind of ambiguity we have. |
A little identifier for flagging temporary lookup results.
| clang::LookupResult::LookupResult | ( | Sema & | SemaRef, |
| const DeclarationNameInfo & | NameInfo, | ||
| Sema::LookupNameKind | LookupKind, | ||
| Sema::RedeclarationKind | Redecl = Sema::NotForRedeclaration |
||
| ) | [inline] |
| clang::LookupResult::LookupResult | ( | Sema & | SemaRef, |
| DeclarationName | Name, | ||
| SourceLocation | NameLoc, | ||
| Sema::LookupNameKind | LookupKind, | ||
| Sema::RedeclarationKind | Redecl = Sema::NotForRedeclaration |
||
| ) | [inline] |
| clang::LookupResult::LookupResult | ( | TemporaryToken | _, |
| const LookupResult & | Other | ||
| ) | [inline] |
| void clang::LookupResult::addAllDecls | ( | const LookupResult & | Other | ) | [inline] |
Add all the declarations from another set of lookup results.
Definition at line 367 of file Lookup.h.
References clang::UnresolvedSetImpl::append(), clang::UnresolvedSetImpl::begin(), clang::UnresolvedSetImpl::end(), and Found.
Referenced by LookupQualifiedNameInUsingDirectives().
| void clang::LookupResult::addDecl | ( | NamedDecl * | D | ) | [inline] |
Add a declaration to these results with its natural access. Does not test the acceptance criteria.
Definition at line 354 of file Lookup.h.
References clang::Decl::getAccess().
Referenced by clang::Sema::ActOnIdExpression(), clang::Sema::ActOnTag(), clang::Sema::ActOnUsingDirective(), clang::Sema::BuildCXXNestedNameSpecifier(), BuildImplicitMemberInitializer(), clang::Sema::CheckFunctionDeclaration(), clang::Sema::CheckFunctionTemplateSpecialization(), clang::Sema::CheckMemberSpecialization(), clang::Sema::CheckVariableDeclaration(), clang::Sema::ClassifyName(), clang::Sema::DefineImplicitCopyAssignment(), clang::Sema::DefineImplicitMoveAssignment(), clang::Sema::DiagnoseEmptyLookup(), DiagnoseInvalidRedeclaration(), LookupBuiltin(), LookupDirect(), clang::Sema::LookupInObjCMethod(), LookupMemberExprInRecord(), clang::Sema::LookupName(), LookupPotentialTypoResult(), clang::Sema::LookupQualifiedName(), clang::Sema::LookupTemplateName(), clang::TreeTransform< Derived >::RebuildMemberExpr(), and TryNamespaceTypoCorrection().
| void clang::LookupResult::addDecl | ( | NamedDecl * | D, |
| AccessSpecifier | AS | ||
| ) | [inline] |
Add a declaration to these results with the given access. Does not test the acceptance criteria.
Definition at line 360 of file Lookup.h.
References clang::UnresolvedSetImpl::addDecl(), and Found.
| const UnresolvedSetImpl& clang::LookupResult::asUnresolvedSet | ( | ) | const [inline] |
Definition at line 259 of file Lookup.h.
Referenced by clang::Sema::CheckDependentFunctionTemplateSpecialization().
| iterator clang::LookupResult::begin | ( | ) | const [inline] |
Definition at line 263 of file Lookup.h.
References clang::UnresolvedSetImpl::begin().
Referenced by clang::Sema::ActOnExplicitInstantiation(), clang::Sema::ActOnIdExpression(), clang::Sema::ActOnTag(), clang::Sema::AddMemberOperatorCandidates(), clang::Sema::BuildCallToObjectOfClassType(), clang::Sema::BuildDeclarationNameExpr(), clang::Sema::BuildMemberReferenceExpr(), clang::Sema::BuildOverloadedArrowExpr(), BuildSingleCopyAssign(), clang::Sema::BuildTemplateIdExpr(), clang::Sema::BuildUsingDeclaration(), clang::Sema::CheckClassTemplate(), clang::Sema::CheckFunctionTemplateSpecialization(), clang::Sema::CheckLookupAccess(), clang::Sema::CheckMemberSpecialization(), clang::Sema::CheckOverload(), clang::Sema::CheckQualifiedMemberReference(), clang::Sema::CheckTypenameType(), clang::Sema::CheckUsingDeclRedeclaration(), clang::Sema::CheckUsingShadowDecl(), ClassifyImplicitMemberAccess(), clang::Sema::ClassifyName(), clang::Sema::CorrectTypo(), clang::Sema::DiagnoseAmbiguousLookup(), clang::Sema::DiagnoseEmptyLookup(), DiagnoseInvalidRedeclaration(), clang::DiagnoseTwoPhaseLookup(), EvaluateUnaryTypeTrait(), clang::Sema::FindAllocationOverload(), clang::Sema::FindDeallocationFunction(), getFoundDecl(), getRepresentativeDecl(), clang::Sema::getTypeName(), clang::Sema::hasAnyAcceptableTemplateNames(), isResultTypeOrTemplate(), clang::Sema::LookupOverloadedOperatorName(), and clang::Sema::UseArgumentDependentLookup().
| void clang::LookupResult::clear | ( | ) | [inline] |
Clears out any current state.
Definition at line 467 of file Lookup.h.
References clang::UnresolvedSetImpl::clear(), NotFound, and NULL.
Referenced by clang::Sema::ActOnAliasDeclaration(), clang::Sema::ActOnIdExpression(), clang::Sema::ActOnTag(), clang::Sema::ActOnTypedefDeclarator(), clang::Sema::ActOnUsingDirective(), clang::Sema::ActOnVariableDeclarator(), clang::Sema::BuildCXXNestedNameSpecifier(), clang::Sema::BuildMemInitializer(), clang::Sema::CheckFunctionDeclaration(), clang::Sema::CheckFunctionTemplateSpecialization(), clang::Sema::CheckMemberSpecialization(), clang::Sema::ClassifyName(), clear(), clang::Sema::CorrectTypo(), clang::Sema::DiagnoseEmptyLookup(), DiagnoseInvalidRedeclaration(), clang::DiagnoseTwoPhaseLookup(), clang::Sema::getDestructorName(), clang::Sema::HandleDeclarator(), LookupMemberExprInRecord(), LookupPotentialTypoResult(), LookupQualifiedNameInUsingDirectives(), clang::Sema::LookupTemplateName(), TryNamespaceTypoCorrection(), and clang::TemplateDeclInstantiator::VisitCXXMethodDecl().
| void clang::LookupResult::clear | ( | Sema::LookupNameKind | Kind | ) | [inline] |
| bool clang::LookupResult::empty | ( | ) | const [inline] |
Return true if no decls were found.
Definition at line 267 of file Lookup.h.
References clang::UnresolvedSetImpl::empty().
Referenced by clang::Sema::ActOnAliasDeclaration(), clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::ActOnIdExpression(), clang::Sema::ActOnNamespaceAliasDef(), clang::Sema::ActOnStartOfLambdaDefinition(), clang::Sema::ActOnTag(), clang::Sema::ActOnTypedefNameDecl(), clang::Sema::ActOnUsingDirective(), clang::Sema::ActOnVariableDeclarator(), clang::Sema::BuildCXXForRangeStmt(), clang::Sema::BuildCXXNestedNameSpecifier(), clang::Sema::BuildImplicitMemberExpr(), clang::Sema::BuildMemberReferenceExpr(), clang::Sema::BuildMemInitializer(), clang::Sema::BuildQualifiedDeclarationNameExpr(), clang::Sema::BuildQualifiedTemplateIdExpr(), clang::Sema::BuildTemplateIdExpr(), clang::Sema::BuildUsingDeclaration(), clang::Sema::CheckDependentFunctionTemplateSpecialization(), clang::Sema::CheckFunctionDeclaration(), clang::Sema::CheckMemberSpecialization(), clang::Sema::CheckUsingShadowDecl(), clang::Sema::CheckVariableDeclaration(), ClassifyImplicitMemberAccess(), clang::Sema::ClassifyName(), clang::Sema::DiagnoseEmptyLookup(), clang::DiagnoseTwoPhaseLookup(), doesUsualArrayDeleteWantSize(), clang::Sema::FindAllocationOverload(), clang::Sema::FindDeallocationFunction(), clang::Sema::getTypeName(), clang::Sema::LookupInObjCMethod(), LookupMemberExprInRecord(), clang::Sema::LookupOverloadedOperatorName(), LookupPotentialTypoResult(), LookupQualifiedNameInUsingDirectives(), clang::Sema::LookupTemplateName(), and clang::TemplateDeclInstantiator::VisitCXXMethodDecl().
| iterator clang::LookupResult::end | ( | ) | const [inline] |
Definition at line 264 of file Lookup.h.
References clang::UnresolvedSetImpl::end().
Referenced by clang::Sema::ActOnExplicitInstantiation(), clang::Sema::AddMemberOperatorCandidates(), clang::Sema::BuildCallToObjectOfClassType(), clang::Sema::BuildDeclarationNameExpr(), clang::Sema::BuildMemberReferenceExpr(), clang::Sema::BuildOverloadedArrowExpr(), BuildSingleCopyAssign(), clang::Sema::BuildTemplateIdExpr(), clang::Sema::BuildUsingDeclaration(), clang::Sema::CheckClassTemplate(), clang::Sema::CheckFunctionTemplateSpecialization(), clang::Sema::CheckLookupAccess(), clang::Sema::CheckMemberSpecialization(), clang::Sema::CheckOverload(), clang::Sema::CheckQualifiedMemberReference(), clang::Sema::CheckUsingDeclRedeclaration(), clang::Sema::CheckUsingShadowDecl(), ClassifyImplicitMemberAccess(), clang::Sema::ClassifyName(), clang::Sema::CorrectTypo(), clang::Sema::DiagnoseAmbiguousLookup(), clang::Sema::DiagnoseEmptyLookup(), DiagnoseInvalidRedeclaration(), clang::DiagnoseTwoPhaseLookup(), EvaluateUnaryTypeTrait(), clang::Sema::FindAllocationOverload(), clang::Sema::FindDeallocationFunction(), clang::Sema::getTypeName(), clang::Sema::hasAnyAcceptableTemplateNames(), clang::LookupResult::Filter::hasNext(), isResultTypeOrTemplate(), clang::Sema::LookupOverloadedOperatorName(), clang::LookupResult::Filter::next(), and clang::Sema::UseArgumentDependentLookup().
Retrieve the accepted (re)declaration of the given declaration, if there is one.
Definition at line 290 of file Lookup.h.
References isHiddenDeclarationVisible(), clang::Decl::isInIdentifierNamespace(), and isVisible().
Referenced by LookupDirect(), and LookupVisibleDecls().
| AmbiguityKind clang::LookupResult::getAmbiguityKind | ( | ) | const [inline] |
Definition at line 254 of file Lookup.h.
References isAmbiguous().
Referenced by clang::Sema::DiagnoseAmbiguousLookup(), and clang::Sema::getTypeName().
| DeclClass* clang::LookupResult::getAsSingle | ( | ) | const [inline] |
Definition at line 420 of file Lookup.h.
References Found, getFoundDecl(), and getResultKind().
Referenced by clang::Sema::ActOnAliasDeclaration(), clang::Sema::ActOnCXXTypeid(), clang::Sema::ActOnCXXUuidof(), clang::Sema::ActOnExplicitInstantiation(), clang::Sema::ActOnIdExpression(), clang::Sema::ActOnStartOfLambdaDefinition(), clang::Sema::BuildBuiltinOffsetOf(), clang::Sema::BuildCXXNestedNameSpecifier(), clang::Sema::BuildDeclarationNameExpr(), clang::Sema::BuildImplicitMemberExpr(), clang::Sema::BuildMemInitializer(), clang::Sema::BuildQualifiedTemplateIdExpr(), clang::Sema::BuildUsingDeclaration(), CheckAnonMemberRedeclaration(), clang::Sema::ClassifyName(), clang::Sema::CorrectTypo(), clang::Sema::getDestructorName(), clang::Sema::HandleField(), clang::Sema::isNonTypeNestedNameSpecifier(), clang::Sema::isTagName(), clang::Sema::LookupSingleName(), clang::Sema::LookupTemplateName(), clang::Sema::MergeTypedefNameDecl(), and clang::TreeTransform< Derived >::RebuildDependentNameType().
| QualType clang::LookupResult::getBaseObjectType | ( | ) | const [inline] |
Returns the base object type associated with this lookup; important for [class.protected]. Most lookups do not have an associated base object.
Definition at line 343 of file Lookup.h.
Referenced by clang::Sema::CheckLookupAccess().
| CXXBasePaths* clang::LookupResult::getBasePaths | ( | ) | const [inline] |
Return the base paths structure that's associated with these results, or null if none is.
Definition at line 271 of file Lookup.h.
Referenced by clang::Sema::DiagnoseAmbiguousLookup().
| SourceRange clang::LookupResult::getContextRange | ( | ) | const [inline] |
Gets the source range of the context of this name; for C++ qualified lookups, this is the source range of the scope specifier.
Definition at line 510 of file Lookup.h.
Referenced by clang::Sema::DiagnoseAmbiguousLookup().
| NamedDecl* clang::LookupResult::getFoundDecl | ( | ) | const [inline] |
Fetch the unique decl found by this lookup. Asserts that one was found.
This is intended for users who have examined the result kind and are certain that there is only one result.
Definition at line 430 of file Lookup.h.
References begin(), Found, and getResultKind().
Referenced by clang::Sema::ActOnAliasDeclaration(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnIdExpression(), clang::Sema::ActOnMethodDeclaration(), clang::Sema::ActOnNamespaceAliasDef(), clang::Sema::ActOnSizeofParameterPackExpr(), clang::Sema::ActOnTag(), clang::Sema::ActOnUsingDirective(), clang::Sema::ActOnVariableDeclarator(), AllowOverloadingOfFunction(), clang::Sema::BuildDeclarationNameExpr(), clang::Sema::BuildMemberReferenceExpr(), clang::Sema::BuildUsingDeclaration(), clang::Sema::CheckFunctionDeclaration(), clang::Sema::CheckMemberSpecialization(), clang::Sema::CheckShadow(), clang::Sema::CheckTypenameType(), doesUsualArrayDeleteWantSize(), getAsSingle(), clang::Sema::getObjCMessageKind(), clang::Sema::getTypeName(), clang::Sema::HandleDeclarator(), isSingleTagDecl(), clang::Sema::LookupInObjCMethod(), LookupPotentialTypoResult(), clang::Sema::LookupTemplateName(), clang::Sema::MergeVarDecl(), and clang::Sema::RegisterLocallyScopedExternCDecl().
| unsigned clang::LookupResult::getIdentifierNamespace | ( | ) | const [inline] |
Returns the identifier namespace mask for this lookup.
Definition at line 305 of file Lookup.h.
Referenced by clang::Sema::LookupName().
| Sema::LookupNameKind clang::LookupResult::getLookupKind | ( | ) | const [inline] |
Gets the kind of lookup to perform.
Definition at line 208 of file Lookup.h.
Referenced by clang::Sema::ActOnSizeofParameterPackExpr(), clang::Sema::BuildCXXNestedNameSpecifier(), clang::Sema::BuildMemInitializer(), clang::Sema::CheckOverload(), clang::Sema::ClassifyName(), clang::Sema::DiagnoseEmptyLookup(), clang::Sema::getObjCMessageKind(), LookupBuiltin(), LookupMemberExprInRecord(), clang::Sema::LookupName(), clang::Sema::LookupQualifiedName(), clang::Sema::LookupTemplateName(), and TryNamespaceTypoCorrection().
| DeclarationName clang::LookupResult::getLookupName | ( | ) | const [inline] |
Gets the name to look up.
Definition at line 198 of file Lookup.h.
References clang::DeclarationNameInfo::getName().
Referenced by clang::Sema::BuildCXXNestedNameSpecifier(), clang::Sema::CheckShadow(), clang::Sema::DiagnoseAmbiguousLookup(), clang::Sema::DiagnoseEmptyLookup(), clang::DiagnoseTwoPhaseLookup(), clang::Sema::getTypeName(), LookupBuiltin(), LookupDirect(), clang::Sema::LookupMemberExpr(), LookupMemberExprInRecord(), clang::Sema::LookupName(), clang::Sema::LookupQualifiedName(), clang::Sema::LookupTemplateName(), and LookupVisibleDecls().
| const DeclarationNameInfo& clang::LookupResult::getLookupNameInfo | ( | ) | const [inline] |
Gets the name info to look up.
Definition at line 188 of file Lookup.h.
Referenced by clang::Sema::ActOnSizeofParameterPackExpr(), clang::Sema::BuildCXXNestedNameSpecifier(), clang::Sema::BuildDeclarationNameExpr(), clang::Sema::BuildMemberReferenceExpr(), clang::Sema::BuildMemInitializer(), clang::Sema::BuildPossibleImplicitMemberExpr(), clang::Sema::BuildTemplateIdExpr(), clang::Sema::CheckQualifiedMemberReference(), clang::Sema::ClassifyName(), clang::Sema::DiagnoseEmptyLookup(), clang::Sema::getObjCMessageKind(), clang::Sema::getTypeName(), clang::Sema::LookupMemberExpr(), LookupMemberExprInRecord(), clang::Sema::LookupTemplateName(), and TryNamespaceTypoCorrection().
| SourceLocation clang::LookupResult::getNameLoc | ( | ) | const [inline] |
Gets the location of the identifier. This isn't always defined: sometimes we're doing lookups on synthesized names.
Definition at line 516 of file Lookup.h.
References clang::DeclarationNameInfo::getLoc().
Referenced by clang::Sema::BuildCXXNestedNameSpecifier(), clang::Sema::BuildDeclarationNameExpr(), clang::Sema::BuildImplicitMemberExpr(), clang::Sema::BuildMemberReferenceExpr(), clang::Sema::BuildMemInitializer(), clang::Sema::CheckLookupAccess(), clang::Sema::CheckShadow(), clang::Sema::DiagnoseAmbiguousLookup(), clang::Sema::DiagnoseEmptyLookup(), clang::DiagnoseTwoPhaseLookup(), LookupBuiltin(), LookupDirect(), clang::Sema::LookupInObjCMethod(), clang::Sema::LookupMemberExpr(), LookupMemberExprInRecord(), clang::Sema::LookupTemplateName(), and LookupVisibleDecls().
| CXXRecordDecl* clang::LookupResult::getNamingClass | ( | ) | const [inline] |
Returns the 'naming class' for this lookup, i.e. the class which was looked into to find these results.
C++0x [class.access.base]p5: The access to a member is affected by the class in which the member is named. This naming class is the class in which the member name was looked up and found. [Note: this class can be explicit, e.g., when a qualified-id is used, or implicit, e.g., when a class member access operator (5.2.5) is used (including cases where an implicit "this->" is added). If both a class member access operator and a qualified-id are used to name the member (as in p->T::m), the class naming the member is the class named by the nested-name-specifier of the qualified-id (that is, T). -- end note ]
This is set by the lookup routines when they find results in a class.
Definition at line 331 of file Lookup.h.
Referenced by clang::Sema::BuildDeclarationNameExpr(), clang::Sema::BuildTemplateIdExpr(), clang::Sema::CheckLookupAccess(), ClassifyImplicitMemberAccess(), clang::Sema::FindAllocationOverload(), and clang::Sema::FindDeallocationFunction().
| NamedDecl* clang::LookupResult::getRepresentativeDecl | ( | ) | const [inline] |
Fetches a representative decl. Useful for lazy diagnostics.
Definition at line 437 of file Lookup.h.
References begin(), and clang::UnresolvedSetImpl::empty().
Referenced by clang::Sema::ActOnAliasDeclaration(), clang::Sema::BuildPossibleImplicitMemberExpr(), CheckAnonMemberRedeclaration(), clang::Sema::CheckFunctionDeclaration(), clang::Sema::CheckQualifiedMemberReference(), clang::Sema::CheckTypenameType(), clang::Sema::HandleField(), clang::Sema::LookupTemplateName(), clang::Sema::MergeTypedefNameDecl(), clang::Sema::MergeVarDecl(), and clang::TreeTransform< Derived >::RebuildDependentNameType().
| LookupResultKind clang::LookupResult::getResultKind | ( | ) | const [inline] |
Definition at line 249 of file Lookup.h.
Referenced by clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnIdExpression(), clang::Sema::ActOnSizeofParameterPackExpr(), AllowOverloadingOfFunction(), clang::Sema::CheckMicrosoftIfExistsSymbol(), clang::Sema::CheckShadow(), clang::Sema::CheckTypenameType(), clang::Sema::ClassifyName(), clang::Sema::CorrectTypo(), getAsSingle(), getFoundDecl(), clang::Sema::getObjCMessageKind(), clang::Sema::getTypeName(), clang::Sema::HandleField(), isAmbiguous(), isOverloadedResult(), isSingleResult(), isSingleTagDecl(), clang::Sema::isTagName(), isUnresolvableResult(), and clang::TreeTransform< Derived >::RebuildDependentNameType().
| Sema& clang::LookupResult::getSema | ( | ) | const [inline] |
Get the Sema object that this lookup result is searching with.
Definition at line 522 of file Lookup.h.
Referenced by isResultTypeOrTemplate(), LookupDirect(), and LookupVisibleDecls().
| bool clang::LookupResult::isAmbiguous | ( | ) | const [inline] |
Definition at line 229 of file Lookup.h.
References Ambiguous, and getResultKind().
Referenced by clang::Sema::ActOnExplicitInstantiation(), clang::Sema::ActOnIdExpression(), clang::Sema::ActOnNamespaceAliasDef(), clang::Sema::ActOnStartOfLambdaDefinition(), clang::Sema::ActOnTag(), clang::Sema::ActOnUsingDirective(), clang::Sema::BuildImplicitMemberExpr(), clang::Sema::BuildMemberReferenceExpr(), clang::Sema::BuildMemInitializer(), clang::Sema::BuildQualifiedDeclarationNameExpr(), clang::Sema::BuildQualifiedTemplateIdExpr(), clang::Sema::BuildTemplateIdExpr(), clang::Sema::BuildUsingDeclaration(), clang::Sema::CheckClassTemplate(), clang::Sema::ClassifyName(), clang::Sema::DiagnoseAmbiguousLookup(), doesUsualArrayDeleteWantSize(), clang::Sema::FindAllocationOverload(), clang::Sema::FindDeallocationFunction(), getAmbiguityKind(), clang::Sema::getDestructorName(), and clang::Sema::LookupOverloadedOperatorName().
| bool clang::LookupResult::isClassLookup | ( | ) | const [inline] |
| bool clang::LookupResult::isForRedeclaration | ( | ) | const [inline] |
True if this lookup is just looking for an existing declaration.
Definition at line 213 of file Lookup.h.
Referenced by clang::Sema::ActOnTag(), LookupBuiltin(), LookupDirect(), clang::Sema::LookupInObjCMethod(), and clang::Sema::LookupQualifiedName().
| bool clang::LookupResult::isHiddenDeclarationVisible | ( | ) | const [inline] |
Determine whether this lookup is permitted to see hidden declarations, such as those in modules that have not yet been imported.
Definition at line 219 of file Lookup.h.
References clang::Sema::LookupTagName.
Referenced by getAcceptableDecl(), and clang::Sema::LookupName().
| bool clang::LookupResult::isOverloadedResult | ( | ) | const [inline] |
Determines if the results are overloaded.
Definition at line 241 of file Lookup.h.
References FoundOverloaded, and getResultKind().
Referenced by clang::Sema::ActOnIdExpression(), clang::Sema::BuildDeclarationNameExpr(), and clang::Sema::BuildMemberReferenceExpr().
| bool clang::LookupResult::isSingleResult | ( | ) | const [inline] |
Determines if this names a single result which is not an unresolved value using decl. If so, it is safe to call getFoundDecl().
Definition at line 236 of file Lookup.h.
References Found, and getResultKind().
Referenced by clang::Sema::ActOnAliasDeclaration(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnMethodDeclaration(), clang::Sema::ActOnTag(), clang::Sema::ActOnVariableDeclarator(), clang::Sema::BuildDeclarationNameExpr(), clang::Sema::BuildMemberReferenceExpr(), clang::Sema::CheckMemberSpecialization(), doesUsualArrayDeleteWantSize(), clang::Sema::HandleDeclarator(), clang::Sema::LookupInObjCMethod(), LookupPotentialTypoResult(), clang::Sema::LookupTemplateName(), clang::Sema::MergeVarDecl(), and clang::Sema::RegisterLocallyScopedExternCDecl().
| bool clang::LookupResult::isSingleTagDecl | ( | ) | const [inline] |
Asks if the result is a single tag decl.
Definition at line 443 of file Lookup.h.
References Found, getFoundDecl(), and getResultKind().
Referenced by clang::Sema::HandleDeclarator(), LookupQualifiedNameInUsingDirectives(), and clang::TemplateDeclInstantiator::VisitCXXMethodDecl().
| bool clang::LookupResult::isSuppressingDiagnostics | ( | ) | const [inline] |
Determines whether this lookup is suppressing diagnostics.
Definition at line 498 of file Lookup.h.
Referenced by clang::Sema::LookupTemplateName().
| bool clang::LookupResult::isUnresolvableResult | ( | ) | const [inline] |
Definition at line 245 of file Lookup.h.
References FoundUnresolvedValue, and getResultKind().
Referenced by clang::Sema::ActOnIdExpression(), clang::Sema::BuildMemberReferenceExpr(), and ClassifyImplicitMemberAccess().
| static bool clang::LookupResult::isVisible | ( | NamedDecl * | D | ) | [inline, static] |
Determine whether the given declaration is visible to the program.
Definition at line 277 of file Lookup.h.
References clang::NamedDecl::isHidden().
Referenced by getAcceptableDecl(), getVisibleDecl(), and clang::Sema::RequireCompleteType().
| Filter clang::LookupResult::makeFilter | ( | ) | [inline] |
Create a filter for this result set.
Definition at line 582 of file Lookup.h.
Referenced by clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::ActOnTag(), BuildSingleCopyAssign(), clang::Sema::BuildUsingDeclaration(), clang::Sema::CheckDependentFunctionTemplateSpecialization(), clang::Sema::DiagnoseAmbiguousLookup(), doesUsualArrayDeleteWantSize(), clang::Sema::FilterAcceptableTemplateNames(), clang::Sema::FilterLookupForScope(), and RemoveUsingDecls().
| void LookupResult::print | ( | raw_ostream & | Out | ) |
Definition at line 471 of file SemaLookup.cpp.
| void LookupResult::resolveKind | ( | ) |
Resolves the result kind of the lookup, possibly hiding decls.
Resolves the result kind of this lookup.
This should be called in any environment where lookup might generate multiple lookup results.
Definition at line 332 of file SemaLookup.cpp.
References AmbiguousReference, Found, FoundOverloaded, FoundUnresolvedValue, clang::Decl::getCanonicalDecl(), and clang::NamedDecl::getUnderlyingDecl().
Referenced by clang::Sema::ActOnTag(), clang::Sema::ActOnUsingDirective(), clang::Sema::ClassifyName(), CppNamespaceLookup(), clang::Sema::LookupName(), LookupPotentialTypoResult(), clang::Sema::LookupQualifiedName(), LookupQualifiedNameInUsingDirectives(), clang::TreeTransform< Derived >::RebuildMemberExpr(), and resolveKindAfterFilter().
| void clang::LookupResult::resolveKindAfterFilter | ( | ) | [inline] |
Re-resolves the result kind of the lookup after a set of removals has been performed.
Definition at line 394 of file Lookup.h.
References Ambiguous, clang::UnresolvedSetImpl::empty(), Found, NotFound, NotFoundInCurrentInstantiation, and resolveKind().
Referenced by clang::LookupResult::Filter::done().
| void LookupResult::setAmbiguousBaseSubobjects | ( | CXXBasePaths & | P | ) |
Make these results show that the name was found in distinct base classes of the same type.
The given paths object is copied and invalidated.
Definition at line 455 of file SemaLookup.cpp.
References clang::CXXBasePaths::swap().
Referenced by clang::Sema::LookupQualifiedName().
| void LookupResult::setAmbiguousBaseSubobjectTypes | ( | CXXBasePaths & | P | ) |
Make these results show that the name was found in base classes of different types.
The given paths object is copied and invalidated.
Definition at line 463 of file SemaLookup.cpp.
References clang::CXXBasePaths::swap().
Referenced by clang::Sema::LookupQualifiedName().
| void clang::LookupResult::setAmbiguousQualifiedTagHiding | ( | ) | [inline] |
Make these results show that the name was found in different contexts and a tag decl was hidden by an ordinary decl in a different context.
Definition at line 462 of file Lookup.h.
References AmbiguousTagHiding.
Referenced by LookupQualifiedNameInUsingDirectives().
| void clang::LookupResult::setBaseObjectType | ( | QualType | T | ) | [inline] |
Sets the base object type for this lookup.
Definition at line 348 of file Lookup.h.
Referenced by clang::Sema::BuildMemberReferenceExpr().
| void clang::LookupResult::setContextRange | ( | SourceRange | SR | ) | [inline] |
Sets a 'context' source range.
Definition at line 503 of file Lookup.h.
Referenced by clang::Sema::BuildCXXNestedNameSpecifier(), clang::Sema::isNonTypeNestedNameSpecifier(), and clang::Sema::LookupParsedName().
| void clang::LookupResult::setHideTags | ( | bool | Hide | ) | [inline] |
Sets whether tag declarations should be hidden by non-tag declarations during resolution. The default is true.
Definition at line 225 of file Lookup.h.
Referenced by clang::Sema::BuildUsingDeclaration(), and clang::TemplateDeclInstantiator::VisitUsingDecl().
| void clang::LookupResult::setLookupName | ( | DeclarationName | Name | ) | [inline] |
Sets the name to look up.
Definition at line 203 of file Lookup.h.
References clang::DeclarationNameInfo::setName().
Referenced by clang::Sema::BuildCXXNestedNameSpecifier(), clang::Sema::BuildMemInitializer(), clang::Sema::ClassifyName(), clang::Sema::CorrectTypo(), clang::Sema::DiagnoseEmptyLookup(), DiagnoseInvalidRedeclaration(), LookupMemberExprInRecord(), LookupPotentialTypoResult(), and clang::Sema::LookupTemplateName().
| void clang::LookupResult::setLookupNameInfo | ( | const DeclarationNameInfo & | NameInfo | ) | [inline] |
| void clang::LookupResult::setNamingClass | ( | CXXRecordDecl * | Record | ) | [inline] |
Sets the 'naming class' for this lookup.
Definition at line 336 of file Lookup.h.
Referenced by clang::Sema::LookupQualifiedName().
| void clang::LookupResult::setNotFoundInCurrentInstantiation | ( | ) | [inline] |
Note that while no result was found in the current instantiation, there were dependent base classes that could not be searched.
Definition at line 380 of file Lookup.h.
References clang::UnresolvedSetImpl::empty(), NotFound, and NotFoundInCurrentInstantiation.
Referenced by clang::Sema::LookupParsedName(), and clang::Sema::LookupQualifiedName().
| void clang::LookupResult::setRedeclarationKind | ( | Sema::RedeclarationKind | RK | ) | [inline] |
Change this lookup's redeclaration kind.
Definition at line 484 of file Lookup.h.
Referenced by clang::Sema::ActOnTag().
| void clang::LookupResult::suppressDiagnostics | ( | ) | [inline] |
Suppress the diagnostics that would normally fire because of this lookup. This happens during (e.g.) redeclaration lookups.
Definition at line 493 of file Lookup.h.
Referenced by clang::Sema::AddMemberOperatorCandidates(), clang::Sema::BuildCallToObjectOfClassType(), clang::Sema::BuildDeclarationNameExpr(), clang::Sema::BuildMemberReferenceExpr(), clang::Sema::BuildMemInitializer(), clang::Sema::BuildOverloadedArrowExpr(), clang::Sema::BuildTemplateIdExpr(), clang::Sema::CheckMicrosoftIfExistsSymbol(), clang::Sema::ClassifyName(), clang::Sema::CorrectTypo(), clang::Sema::DiagnoseEmptyLookup(), clang::DiagnoseTwoPhaseLookup(), doesUsualArrayDeleteWantSize(), EvaluateUnaryTypeTrait(), clang::Sema::FindAllocationOverload(), clang::Sema::FindDeallocationFunction(), clang::Sema::getObjCMessageKind(), clang::Sema::getTypeName(), clang::Sema::HandleField(), clang::Sema::isNonTypeNestedNameSpecifier(), clang::Sema::isTagName(), and LookupPotentialTypoResult().
| bool clang::LookupResult::wasNotFoundInCurrentInstantiation | ( | ) | const [inline] |
Determine whether no result was found because we could not search into dependent base classes of the current instantiation.
Definition at line 374 of file Lookup.h.
References NotFoundInCurrentInstantiation.
Referenced by clang::Sema::ActOnTag().