clang: clang::LookupResult Class Reference (original) (raw)
Represents the results of name lookup. More...
#include "[clang/Sema/Lookup.h](Sema%5F2Lookup%5F8h%5Fsource.html)"
Classes | |
---|---|
class | Filter |
A class for iterating through a result set and possibly filtering out results. More... | |
Public Types | |
---|---|
enum | LookupResultKind { NotFound = 0 , NotFoundInCurrentInstantiation, Found, FoundOverloaded, FoundUnresolvedValue, Ambiguous } |
enum | AmbiguityKind { AmbiguousBaseSubobjectTypes, AmbiguousBaseSubobjects, AmbiguousReference, AmbiguousReferenceToPlaceholderVariable, AmbiguousTagHiding } |
enum | TemporaryToken { Temporary } |
A little identifier for flagging temporary lookup results. More... | |
using | iterator = UnresolvedSetImpl::iterator |
Public Member Functions | |
---|---|
LookupResult (Sema &SemaRef, const DeclarationNameInfo &NameInfo, Sema::LookupNameKind LookupKind, RedeclarationKind Redecl=RedeclarationKind::NotForRedeclaration) | |
LookupResult (Sema &SemaRef, DeclarationName Name, SourceLocation NameLoc, Sema::LookupNameKind LookupKind, RedeclarationKind Redecl=RedeclarationKind::NotForRedeclaration) | |
LookupResult (TemporaryToken _, const LookupResult &Other) | |
Creates a temporary lookup result, initializing its core data using the information from another result. | |
LookupResult (const LookupResult &)=delete | |
LookupResult & | operator= (const LookupResult &)=delete |
LookupResult (LookupResult &&Other) | |
LookupResult & | operator= (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 | isForExternalRedeclaration () const |
True if this lookup is just looking for an existing declaration to link against a declaration with external linkage. | |
RedeclarationKind | redeclarationKind () const |
void | setAllowHidden (bool AH) |
Specify whether hidden declarations are visible, e.g., for recovery reasons. | |
bool | isHiddenDeclarationVisible (NamedDecl *ND) 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) |
Sets whether tag declarations should be hidden by non-tag declarations during resolution. | |
void | setTemplateNameLookup (bool TemplateName) |
Sets whether this is a template-name lookup. | |
bool | isTemplateNameLookup () const |
bool | isAmbiguous () const |
bool | isSingleResult () const |
Determines if this names a single result which is not an unresolved value using decl. | |
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. | |
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]. | |
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. | |
void | addDecl (NamedDecl *D, AccessSpecifier AS) |
Add a declaration to these results with the given access. | |
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. | |
bool | isShadowed () const |
Determine whether the lookup result was shadowed by some other declaration that lookup ignored. | |
void | setShadowed () |
Note that we found and ignored a declaration while performing lookup. | |
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 | |
DeclClass * | getAsSingle () const |
NamedDecl * | getFoundDecl () const |
Fetch the unique decl found by this lookup. | |
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. | |
LLVM_ATTRIBUTE_REINITIALIZES 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 (RedeclarationKind RK) |
Change this lookup's redeclaration kind. | |
void | dump () |
void | print (raw_ostream &) |
void | suppressDiagnostics () |
Suppress the diagnostics that would normally fire because of this lookup. | |
void | suppressAccessDiagnostics () |
Suppress the diagnostics that would normally fire because of this lookup due to access control violations. | |
bool | isSuppressingAccessDiagnostics () const |
Determines whether this lookup is suppressing access control diagnostics. | |
bool | isSuppressingAmbiguousDiagnostics () const |
Determines whether this lookup is suppressing ambiguous lookup diagnostics. | |
void | setContextRange (SourceRange SR) |
Sets a 'context' source range. | |
SourceRange | getContextRange () const |
Gets the source range of the context of this name; for C++ qualified lookups, this is the source range of the scope specifier. | |
SourceLocation | getNameLoc () const |
Gets the location of the identifier. | |
Sema & | getSema () const |
Get the Sema object that this lookup result is searching with. | |
Filter | makeFilter () |
Create a filter for this result set. | |
void | setFindLocalExtern (bool FindLocalExtern) |
Static Public Member Functions | |
---|---|
static bool | isVisible (Sema &SemaRef, NamedDecl *D) |
Determine whether the given declaration is visible to the program. | |
static bool | isReachable (Sema &SemaRef, NamedDecl *D) |
static bool | isAcceptable (Sema &SemaRef, NamedDecl *D, Sema::AcceptableKind Kind) |
static bool | isAvailableForLookup (Sema &SemaRef, NamedDecl *ND) |
Determine whether this lookup is permitted to see the declaration. | |
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.
Definition at line 46 of file Lookup.h.
◆ iterator
◆ AmbiguityKind
Enumerator | |
---|---|
AmbiguousBaseSubobjectTypes | Name lookup results in an ambiguity because multiple entities that meet the lookup criteria were found in subobjects of different types. For example: struct A { void f(int); } struct B { void f(double); } struct C : A, B { }; void test(C c) { c.f(0); } c__device__ __2f16 float cDefinition: __clang_hip_libdevice_declares.h:304 clang::LinkageSpecLanguageIDs::C@ C |
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: struct A { int x; }; struct B : A { }; struct C : A { }; struct D : B, C { }; int test(D d) { return d.x; } Dconst Decl * DDefinition: CheckExprLifetime.cpp:211 |
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; } } |
AmbiguousReferenceToPlaceholderVariable | Name lookup results in an ambiguity because multiple placeholder variables were found in the same scope. void f() { int _ = 0; int _ = 0; return _; } |
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. namespace A { struct Foo {}; } namespace B { void Foo(); } namespace C { using namespace A; using namespace B; } void test() { C::Foo(); } |
Definition at line 76 of file Lookup.h.
◆ LookupResultKind
Enumerator | |
---|---|
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. |
Definition at line 48 of file Lookup.h.
◆ TemporaryToken
A little identifier for flagging temporary lookup results.
Enumerator |
---|
Temporary |
Definition at line 150 of file Lookup.h.
◆ LookupResult() [2/5]
◆ LookupResult() [3/5]
Creates a temporary lookup result, initializing its core data using the information from another result.
Diagnostics are always disabled.
Definition at line 186 of file Lookup.h.
◆ LookupResult() [4/5]
clang::LookupResult::LookupResult ( const LookupResult & ) | delete |
---|
◆ LookupResult() [5/5]
clang::LookupResult::LookupResult ( LookupResult && Other) | inline |
---|
◆ ~LookupResult()
clang::LookupResult::~LookupResult ( ) | inline |
---|
◆ addAllDecls()
void clang::LookupResult::addAllDecls ( const LookupResult & Other) | inline |
---|
◆ addDecl() [1/2]
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 475 of file Lookup.h.
Referenced by clang::Sema::ActOnIdExpression(), clang::Sema::ActOnUsingDirective(), addDecl(), attemptRecovery(), BuildImplicitMemberInitializer(), clang::Sema::BuildUsingDeclaration(), clang::Sema::CheckImplicitSpecialMemberDeclaration(), clang::Sema::DefineImplicitCopyAssignment(), clang::Sema::DefineImplicitMoveAssignment(), clang::Sema::DiagnoseEmptyLookup(), DiagnoseTwoPhaseLookup(), InsertOCLBuiltinDeclarationsFromTable(), clang::Sema::LookupBuiltin(), LookupDirect(), clang::Sema::LookupInSuper(), clang::Sema::LookupName(), LookupPotentialTypoResult(), clang::TreeTransform< Derived >::RebuildMemberExpr(), clang::TreeTransform< Derived >::TransformOverloadExprDecls(), and TryNamespaceTypoCorrection().
◆ addDecl() [2/2]
◆ asUnresolvedSet()
◆ begin()
iterator clang::LookupResult::begin ( ) const | inline |
---|
Definition at line 358 of file Lookup.h.
References clang::UnresolvedSetImpl::begin().
Referenced by clang::Sema::ActOnParamDeclarator(), clang::Sema::AddMemberOperatorCandidates(), clang::Sema::AddOverloadedCallCandidates(), clang::Sema::BuildDeclarationNameExpr(), buildDeclareReductionRef(), clang::Sema::BuildMemberReferenceExpr(), clang::Sema::BuildOverloadedArrowExpr(), clang::Sema::BuildPossibleImplicitMemberExpr(), BuildRecoveryCallExpr(), buildSingleCopyAssignRecursively(), clang::Sema::BuildTemplateIdExpr(), buildUserDefinedMapperRef(), clang::Sema::BuildUsingDeclaration(), clang::Sema::CheckLookupAccess(), clang::Sema::CheckOverload(), clang::Sema::CheckQualifiedMemberReference(), clang::Sema::CheckUsingDeclRedeclaration(), ClassifyImplicitMemberAccess(), CXXRecordMembersNamed(), clang::Sema::DeduceTemplateSpecializationFromInitializer(), clang::Sema::DiagnoseDependentMemberLookup(), DiagnoseInvalidRedeclaration(), clang::Sema::FindAllocationFunctions(), getFoundDecl(), getRepresentativeDecl(), clang::Sema::hasAnyAcceptableTemplateNames(), HasNoThrowOperator(), hasUserDefinedMapper(), clang::Sema::isPotentialImplicitMemberAccess(), isResultTypeOrTemplate(), clang::Sema::isTemplateName(), clang::Sema::LookupOverloadedOperatorName(), print(), resolveAllocationOverload(), resolveBuiltinNewDeleteOverload(), and resolveDeallocationOverload().
◆ clear() [1/2]
LLVM_ATTRIBUTE_REINITIALIZES void clang::LookupResult::clear ( ) | inline |
---|
Clears out any current state.
Definition at line 605 of file Lookup.h.
References clang::UnresolvedSetImpl::clear(), and NotFound.
Referenced by clang::Sema::ActOnIdExpression(), clang::Sema::ActOnNamespaceAliasDef(), clang::Sema::ActOnUsingDirective(), buildDeclareReductionRef(), clang::Sema::BuildMemInitializer(), BuildRecoveryCallExpr(), buildUserDefinedMapperRef(), clear(), clang::Sema::DiagnoseEmptyLookup(), DiagnoseTwoPhaseLookup(), clang::Sema::FindAllocationFunctions(), hasUserDefinedMapper(), LookupPotentialTypoResult(), LookupQualifiedNameInUsingDirectives(), clang::Sema::LookupTemplateName(), resolveAllocationOverload(), clang::TreeTransform< Derived >::TransformOverloadExprDecls(), and TryNamespaceTypoCorrection().
◆ clear() [2/2]
Clears out any current state and re-initializes for a different kind of lookup.
Definition at line 616 of file Lookup.h.
◆ dump()
LLVM_DUMP_METHOD void LookupResult::dump | ( | ) |
---|
◆ empty()
bool clang::LookupResult::empty ( ) const | inline |
---|
Return true if no decls were found.
Definition at line 362 of file Lookup.h.
References clang::UnresolvedSetImpl::empty().
Referenced by clang::Sema::ActOnIdExpression(), clang::Sema::ActOnLambdaExpressionAfterIntroducer(), clang::Sema::ActOnNamespaceAliasDef(), clang::SemaOpenMP::ActOnOpenMPIdExpression(), clang::Sema::ActOnParamDeclarator(), clang::Sema::ActOnPragmaUnused(), clang::Sema::ActOnUsingDirective(), clang::Sema::BuildCXXNestedNameSpecifier(), buildDeclareReductionRef(), clang::Sema::BuildForRangeBeginEndCall(), clang::Sema::BuildImplicitMemberExpr(), clang::Sema::BuildMemberReferenceExpr(), clang::Sema::BuildMemInitializer(), BuildNonArrayForRange(), clang::Sema::BuildQualifiedDeclarationNameExpr(), clang::Sema::BuildQualifiedTemplateIdExpr(), BuildRecoveryCallExpr(), clang::Sema::BuildUsingDeclaration(), ClassifyImplicitMemberAccess(), clang::Sema::DeduceTemplateSpecializationFromInitializer(), clang::Sema::DiagnoseEmptyLookup(), DiagnoseInvalidRedeclaration(), DiagnoseTwoPhaseLookup(), doesUsualArrayDeleteWantSize(), emitReplacement(), clang::Sema::EvaluateStaticAssertMessageAsString(), clang::Sema::FindAllocationFunctions(), getTupleLikeElementType(), clang::Sema::isDeductionGuideName(), clang::Sema::isPotentialImplicitMemberAccess(), clang::Sema::isTemplateName(), isTupleLike(), clang::SemaObjC::LookupInObjCMethod(), clang::Sema::LookupInSuper(), clang::SemaObjC::LookupIvarInObjCMethod(), LookupMemberExprInRecord(), clang::LookupNamed(), clang::LookupNamespace(), LookupPotentialTypoResult(), LookupQualifiedNameInUsingDirectives(), clang::Sema::LookupTemplateName(), clang::MultiplexExternalSemaSource::LookupUnqualified(), resolveBuiltinNewDeleteOverload(), and clang::TreeTransform< Derived >::TransformOverloadExprDecls().
◆ end()
iterator clang::LookupResult::end ( ) const | inline |
---|
Definition at line 359 of file Lookup.h.
References clang::UnresolvedSetImpl::end().
Referenced by clang::Sema::AddMemberOperatorCandidates(), clang::Sema::AddOverloadedCallCandidates(), clang::Sema::BuildDeclarationNameExpr(), buildDeclareReductionRef(), clang::Sema::BuildMemberReferenceExpr(), clang::Sema::BuildOverloadedArrowExpr(), clang::Sema::BuildPossibleImplicitMemberExpr(), buildSingleCopyAssignRecursively(), clang::Sema::BuildTemplateIdExpr(), buildUserDefinedMapperRef(), clang::Sema::BuildUsingDeclaration(), clang::Sema::CheckLookupAccess(), clang::Sema::CheckOverload(), clang::Sema::CheckQualifiedMemberReference(), clang::Sema::CheckUsingDeclRedeclaration(), CXXRecordMembersNamed(), clang::Sema::DeduceTemplateSpecializationFromInitializer(), DiagnoseInvalidRedeclaration(), clang::Sema::FindAllocationFunctions(), clang::Sema::hasAnyAcceptableTemplateNames(), HasNoThrowOperator(), hasUserDefinedMapper(), isResultTypeOrTemplate(), clang::Sema::isTemplateName(), clang::Sema::LookupOverloadedOperatorName(), print(), resolveAllocationOverload(), resolveBuiltinNewDeleteOverload(), and resolveDeallocationOverload().
◆ getAcceptableDecl()
◆ getAmbiguityKind()
AmbiguityKind clang::LookupResult::getAmbiguityKind ( ) const | inline |
---|
◆ getAsSingle()
template
DeclClass * clang::LookupResult::getAsSingle ( ) const | inline |
---|
Definition at line 558 of file Lookup.h.
References Found, getFoundDecl(), and getResultKind().
Referenced by clang::Sema::ActOnCXXTypeid(), clang::Sema::ActOnEnumConstant(), clang::Sema::ActOnIdExpression(), clang::Sema::ActOnLambdaExpressionAfterIntroducer(), clang::SemaOpenMP::ActOnOpenMPIdExpression(), clang::Sema::ActOnPragmaUnused(), clang::Sema::ActOnUsingDirective(), clang::Sema::BuildBuiltinCallExpr(), clang::Sema::BuildBuiltinOffsetOf(), clang::Sema::BuildCXXNestedNameSpecifier(), clang::Sema::BuildDeclarationNameExpr(), buildMemcpyForAssignmentOp(), clang::Sema::BuildMemInitializer(), clang::Sema::BuildQualifiedDeclarationNameExpr(), clang::Sema::BuildTemplateIdExpr(), clang::Sema::BuildUsingDeclaration(), clang::Sema::CheckOverload(), clang::Sema::CheckUsingDeclQualifier(), getTupleLikeElementType(), clang::Sema::isDeductionGuideName(), clang::Sema::isTagName(), isTagTypeWithMissingTag(), clang::SemaOpenMP::lookupOpenMPDeclareTargetName(), lookupPromiseType(), clang::Sema::LookupSingleName(), LookupStdSourceLocationImpl(), and clang::Sema::MergeTypedefNameDecl().
◆ getBaseObjectType()
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 464 of file Lookup.h.
Referenced by clang::Sema::CheckLookupAccess().
◆ getBasePaths()
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 366 of file Lookup.h.
◆ getContextRange()
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 658 of file Lookup.h.
◆ getFoundDecl()
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 568 of file Lookup.h.
References begin(), Found, and getResultKind().
Referenced by clang::Sema::ActOnIdExpression(), clang::SemaObjC::ActOnMethodParmDeclaration(), clang::Sema::ActOnNamespaceAliasDef(), clang::SemaOpenMP::ActOnOpenMPIdExpression(), clang::Sema::ActOnSizeofParameterPackExpr(), clang::Sema::BuildDeclarationNameExpr(), clang::Sema::BuildMemberReferenceExpr(), clang::Sema::BuildTemplateIdExpr(), clang::Sema::BuildUsingDeclaration(), CheckObjCBridgeCFCast(), CheckObjCBridgeNSCast(), clang::SemaObjC::checkObjCBridgeRelatedComponents(), emitReplacement(), getAsSingle(), clang::Sema::getShadowedDeclaration(), clang::Sema::isPotentialImplicitMemberAccess(), isSingleTagDecl(), lookupBuiltinFunction(), clang::Sema::LookupInlineAsmField(), clang::Sema::LookupInlineAsmVarDeclField(), clang::SemaObjC::LookupIvarInObjCMethod(), clang::LookupNamed(), clang::LookupNamespace(), LookupPotentialTypoResult(), clang::Sema::LookupTemplateName(), and ShouldLookupResultBeMultiVersionOverload().
◆ getIdentifierNamespace()
unsigned clang::LookupResult::getIdentifierNamespace ( ) const | inline |
---|
◆ getLookupKind()
Gets the kind of lookup to perform.
Definition at line 275 of file Lookup.h.
Referenced by clang::Sema::ActOnSizeofParameterPackExpr(), clang::Sema::BuildMemInitializer(), clang::Sema::BuildUsingDeclaration(), clang::Sema::CheckOverload(), clang::Sema::DiagnoseEmptyLookup(), DiagnoseInvalidRedeclaration(), clang::Sema::LookupBuiltin(), clang::Sema::LookupInSuper(), LookupMemberExprInRecord(), clang::Sema::LookupName(), clang::Sema::LookupQualifiedName(), clang::Sema::resolveAssumedTemplateNameAsType(), resolveKind(), and TryNamespaceTypoCorrection().
◆ getLookupName()
Gets the name to look up.
Definition at line 265 of file Lookup.h.
References clang::DeclarationNameInfo::getName().
Referenced by clang::Sema::BuildLiteralOperatorCall(), clang::Sema::BuildMemberReferenceExpr(), clang::Sema::CheckShadow(), clang::Sema::DiagnoseDependentMemberLookup(), clang::Sema::DiagnoseEmptyLookup(), DiagnoseTwoPhaseLookup(), dump(), clang::Sema::LookupBuiltin(), LookupDirect(), clang::Sema::LookupLiteralOperator(), LookupMemberExpr(), LookupMemberExprInRecord(), clang::Sema::LookupName(), clang::Sema::LookupQualifiedName(), resolveAllocationOverload(), clang::Sema::resolveAssumedTemplateNameAsType(), resolveBuiltinNewDeleteOverload(), and clang::TreeTransform< Derived >::TransformOverloadExprDecls().
◆ getLookupNameInfo()
Gets the name info to look up.
Definition at line 255 of file Lookup.h.
Referenced by clang::Sema::ActOnSizeofParameterPackExpr(), clang::Sema::BuildDeclarationNameExpr(), clang::Sema::BuildMemberReferenceExpr(), clang::Sema::BuildMemInitializer(), clang::Sema::BuildPossibleImplicitMemberExpr(), clang::Sema::BuildTemplateIdExpr(), clang::Sema::BuildUsingDeclaration(), clang::Sema::CheckQualifiedMemberReference(), clang::Sema::DiagnoseEmptyLookup(), DiagnoseInvalidRedeclaration(), clang::Sema::LookupInSuper(), LookupMemberExpr(), LookupMemberExprInRecord(), clang::Sema::resolveAssumedTemplateNameAsType(), and TryNamespaceTypoCorrection().
◆ getNameLoc()
Gets the location of the identifier.
This isn't always defined: sometimes we're doing lookups on synthesized names.
Definition at line 664 of file Lookup.h.
References clang::DeclarationNameInfo::getLoc().
Referenced by clang::Sema::BuildCXXNestedNameSpecifier(), clang::Sema::BuildDeclarationNameExpr(), clang::Sema::BuildImplicitMemberExpr(), clang::Sema::BuildLiteralOperatorCall(), clang::Sema::BuildMemberReferenceExpr(), clang::Sema::BuildPossibleImplicitMemberExpr(), clang::Sema::BuildTemplateIdExpr(), clang::Sema::CheckLookupAccess(), clang::Sema::CheckShadow(), clang::Sema::DiagnoseDependentMemberLookup(), clang::Sema::DiagnoseEmptyLookup(), DiagnoseTwoPhaseLookup(), clang::Sema::EvaluateStaticAssertMessageAsString(), InsertOCLBuiltinDeclarationsFromTable(), clang::Sema::LookupBuiltin(), LookupDirect(), clang::SemaObjC::LookupInObjCMethod(), clang::SemaObjC::LookupIvarInObjCMethod(), clang::Sema::LookupLiteralOperator(), LookupMemberExpr(), LookupMemberExprInRecord(), resolveAllocationOverload(), clang::Sema::resolveAssumedTemplateNameAsType(), resolveBuiltinNewDeleteOverload(), resolveKind(), shouldWarnIfShadowedDecl(), and clang::TreeTransform< Derived >::TransformOverloadExprDecls().
◆ getNamingClass()
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 452 of file Lookup.h.
Referenced by clang::Sema::BuildDeclarationNameExpr(), clang::Sema::BuildPossibleImplicitMemberExpr(), clang::Sema::BuildTemplateIdExpr(), clang::Sema::CheckLookupAccess(), ClassifyImplicitMemberAccess(), clang::Sema::DiagnoseDependentMemberLookup(), clang::Sema::FindAllocationFunctions(), resolveAllocationOverload(), and resolveBuiltinNewDeleteOverload().
◆ getRepresentativeDecl()
NamedDecl * clang::LookupResult::getRepresentativeDecl ( ) const | inline |
---|
Fetches a representative decl. Useful for lazy diagnostics.
Definition at line 575 of file Lookup.h.
References begin(), and clang::UnresolvedSetImpl::empty().
Referenced by clang::Sema::ActOnNamespaceAliasDef(), clang::Sema::ActOnStartNamespaceDef(), clang::Sema::ActOnUsingDirective(), clang::Sema::BuildDeclarationNameExpr(), buildDeclareReductionRef(), clang::Sema::BuildPossibleImplicitMemberExpr(), clang::Sema::BuildTemplateIdExpr(), buildUserDefinedMapperRef(), CheckAnonMemberRedeclaration(), clang::Sema::CheckQualifiedMemberReference(), clang::Sema::DiagnoseDependentMemberLookup(), getTupleLikeElementType(), hasUserDefinedMapper(), clang::Sema::MergeTypedefNameDecl(), and clang::TreeTransform< Derived >::TransformOverloadExprDecls().
◆ getResultKind()
Definition at line 344 of file Lookup.h.
Referenced by clang::Sema::ActOnSizeofParameterPackExpr(), clang::Sema::CheckMicrosoftIfExistsSymbol(), getAsSingle(), getFoundDecl(), isAmbiguous(), isOverloadedResult(), isSingleResult(), isSingleTagDecl(), clang::Sema::isTagName(), isUnresolvableResult(), clang::Sema::LookupLiteralOperator(), and shouldWarnIfShadowedDecl().
◆ getSema()
Sema & clang::LookupResult::getSema ( ) const | inline |
---|
◆ isAcceptable()
◆ isAmbiguous()
bool clang::LookupResult::isAmbiguous ( ) const | inline |
---|
Definition at line 324 of file Lookup.h.
References Ambiguous, and getResultKind().
Referenced by clang::Sema::ActOnIdExpression(), clang::Sema::ActOnLambdaExpressionAfterIntroducer(), clang::Sema::ActOnNamespaceAliasDef(), clang::SemaOpenMP::ActOnOpenMPIdExpression(), clang::Sema::ActOnTemplateName(), clang::Sema::ActOnUsingDirective(), clang::Sema::BuildBuiltinOffsetOf(), clang::Sema::BuildImplicitMemberExpr(), clang::Sema::BuildMemberReferenceExpr(), clang::Sema::BuildMemInitializer(), BuildNonArrayForRange(), clang::Sema::BuildOperatorCoawaitLookupExpr(), clang::Sema::BuildOverloadedArrowExpr(), clang::Sema::BuildQualifiedDeclarationNameExpr(), clang::Sema::BuildQualifiedTemplateIdExpr(), BuildRecoveryCallExpr(), clang::Sema::BuildTemplateIdExpr(), clang::Sema::BuildUsingDeclaration(), checkTupleLikeDecomposition(), DiagnoseInvalidRedeclaration(), doesUsualArrayDeleteWantSize(), clang::Sema::FindAllocationFunctions(), getAmbiguityKind(), clang::Sema::isDeductionGuideName(), clang::Sema::isTemplateName(), clang::SemaOpenMP::lookupOpenMPDeclareTargetName(), clang::Sema::LookupOverloadedOperatorName(), lookupStdTypeTraitMember(), clang::Sema::LookupTemplateName(), print(), and resolveBuiltinNewDeleteOverload().
◆ isAvailableForLookup()
◆ isClassLookup()
bool clang::LookupResult::isClassLookup ( ) const | inline |
---|
◆ isForExternalRedeclaration()
bool clang::LookupResult::isForExternalRedeclaration ( ) const | inline |
---|
True if this lookup is just looking for an existing declaration to link against a declaration with external linkage.
Definition at line 286 of file Lookup.h.
Referenced by isHiddenDeclarationVisible().
◆ isForRedeclaration()
bool clang::LookupResult::isForRedeclaration ( ) const | inline |
---|
◆ isHiddenDeclarationVisible()
bool clang::LookupResult::isHiddenDeclarationVisible ( NamedDecl * ND) const | inline |
---|
◆ isOverloadedResult()
bool clang::LookupResult::isOverloadedResult ( ) const | inline |
---|
◆ isReachable()
◆ isShadowed()
bool clang::LookupResult::isShadowed ( ) const | inline |
---|
Determine whether the lookup result was shadowed by some other declaration that lookup ignored.
Definition at line 510 of file Lookup.h.
◆ isSingleResult()
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 331 of file Lookup.h.
References Found, and getResultKind().
Referenced by clang::SemaObjC::ActOnMethodParmDeclaration(), clang::Sema::ActOnNamespaceAliasDef(), clang::SemaOpenMP::ActOnOpenMPIdExpression(), clang::Sema::ActOnParamDeclarator(), clang::Sema::ActOnStartNamespaceDef(), clang::Sema::BuildDeclarationNameExpr(), clang::Sema::BuildMemberReferenceExpr(), clang::Sema::BuildTemplateIdExpr(), emitReplacement(), lookupBuiltinFunction(), clang::Sema::LookupInlineAsmField(), clang::SemaObjC::LookupIvarInObjCMethod(), clang::LookupNamed(), clang::SemaOpenMP::lookupOpenMPDeclareTargetName(), LookupPotentialTypoResult(), clang::Sema::LookupTemplateName(), and ShouldLookupResultBeMultiVersionOverload().
◆ isSingleTagDecl()
bool clang::LookupResult::isSingleTagDecl ( ) const | inline |
---|
◆ isSuppressingAccessDiagnostics()
bool clang::LookupResult::isSuppressingAccessDiagnostics ( ) const | inline |
---|
Determines whether this lookup is suppressing access control diagnostics.
Definition at line 644 of file Lookup.h.
◆ isSuppressingAmbiguousDiagnostics()
bool clang::LookupResult::isSuppressingAmbiguousDiagnostics ( ) const | inline |
---|
Determines whether this lookup is suppressing ambiguous lookup diagnostics.
Definition at line 648 of file Lookup.h.
◆ isTemplateNameLookup()
bool clang::LookupResult::isTemplateNameLookup ( ) const | inline |
---|
◆ isUnresolvableResult()
bool clang::LookupResult::isUnresolvableResult ( ) const | inline |
---|
◆ isVisible()
◆ makeFilter()
Filter clang::LookupResult::makeFilter ( ) | inline |
---|
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ print()
void LookupResult::print | ( | raw_ostream & | Out | ) |
---|
◆ redeclarationKind()
◆ resolveKind()
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 484 of file SemaLookup.cpp.
References Ambiguous, AmbiguousReference, AmbiguousReferenceToPlaceholderVariable, clang::UnresolvedSetImpl::begin(), canHideTag(), clang::Sema::Context, D, clang::Sema::diagnoseEquivalentInternalLinkageDeclarations(), Found, FoundOverloaded, FoundUnresolvedValue, clang::Decl::getCanonicalDecl(), clang::ASTContext::getCanonicalType(), getContextForScopeMatching(), getLookupKind(), getNameLoc(), getSema(), clang::ASTContext::getTypeDeclType(), clang::Decl::isInvalidDecl(), isPreferredLookupResult(), NotFound, NotFoundInCurrentInstantiation, clang::UnresolvedSetImpl::size(), clang::T, and clang::UnresolvedSetImpl::truncate().
Referenced by clang::Sema::ActOnUsingDirective(), BuildImplicitMemberInitializer(), clang::Sema::BuildUsingDeclaration(), clang::Sema::CheckImplicitSpecialMemberDeclaration(), CppNamespaceLookup(), clang::Sema::DefineImplicitCopyAssignment(), clang::Sema::DefineImplicitMoveAssignment(), clang::Sema::DiagnoseEmptyLookup(), DiagnoseTwoPhaseLookup(), InsertOCLBuiltinDeclarationsFromTable(), clang::Sema::LookupInSuper(), clang::Sema::LookupName(), clang::LookupNamed(), clang::LookupNamespace(), LookupPotentialTypoResult(), clang::Sema::LookupQualifiedName(), LookupQualifiedNameInUsingDirectives(), clang::TreeTransform< Derived >::RebuildMemberExpr(), resolveKindAfterFilter(), setAmbiguousBaseSubobjects(), setAmbiguousBaseSubobjectTypes(), and clang::TreeTransform< Derived >::TransformOverloadExprDecls().
◆ resolveKindAfterFilter()
void clang::LookupResult::resolveKindAfterFilter ( ) | inline |
---|
◆ setAllowHidden()
void clang::LookupResult::setAllowHidden ( bool AH) | inline |
---|
◆ setAmbiguousBaseSubobjects()
void LookupResult::setAmbiguousBaseSubobjects | ( | CXXBasePaths & | P | ) |
---|
◆ setAmbiguousBaseSubobjectTypes()
void LookupResult::setAmbiguousBaseSubobjectTypes | ( | CXXBasePaths & | P | ) |
---|
◆ setAmbiguousQualifiedTagHiding()
void clang::LookupResult::setAmbiguousQualifiedTagHiding ( ) | inline |
---|
◆ setBaseObjectType()
void clang::LookupResult::setBaseObjectType ( QualType T) | inline |
---|
◆ setContextRange()
void clang::LookupResult::setContextRange ( SourceRange SR) | inline |
---|
◆ setFindLocalExtern()
void clang::LookupResult::setFindLocalExtern ( bool FindLocalExtern) | inline |
---|
◆ setHideTags()
void clang::LookupResult::setHideTags ( bool Hide) | inline |
---|
◆ setLookupName()
◆ setLookupNameInfo()
Sets the name info to look up.
Definition at line 260 of file Lookup.h.
◆ setNamingClass()
void clang::LookupResult::setNamingClass ( CXXRecordDecl * Record) | inline |
---|
◆ setNotFoundInCurrentInstantiation()
void clang::LookupResult::setNotFoundInCurrentInstantiation ( ) | inline |
---|
◆ setRedeclarationKind()
Change this lookup's redeclaration kind.
Definition at line 623 of file Lookup.h.
◆ setShadowed()
void clang::LookupResult::setShadowed ( ) | inline |
---|
◆ setTemplateNameLookup()
void clang::LookupResult::setTemplateNameLookup ( bool TemplateName) | inline |
---|
Sets whether this is a template-name lookup.
For template-name lookups, injected-class-names are treated as naming a template rather than a template specialization.
Definition at line 318 of file Lookup.h.
Referenced by clang::Sema::LookupTemplateName().
◆ suppressAccessDiagnostics()
void clang::LookupResult::suppressAccessDiagnostics ( ) | inline |
---|
◆ suppressDiagnostics()
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 634 of file Lookup.h.
Referenced by clang::SemaOpenMP::ActOnOpenMPIdExpression(), clang::Sema::ActOnPragmaDump(), clang::Sema::BuildCXXNestedNameSpecifier(), clang::Sema::BuildDeclarationNameExpr(), buildDeclareReductionRef(), clang::Sema::BuildMemberReferenceExpr(), clang::Sema::BuildMemInitializer(), clang::Sema::BuildPossibleImplicitMemberExpr(), BuildRecoveryCallExpr(), clang::Sema::BuildTemplateIdExpr(), buildUserDefinedMapperRef(), clang::Sema::BuildUsingDeclaration(), clang::Sema::CheckImplicitSpecialMemberDeclaration(), clang::Sema::CheckMicrosoftIfExistsSymbol(), CXXRecordMembersNamed(), clang::Sema::DeduceTemplateSpecializationFromInitializer(), clang::Sema::DiagnoseEmptyLookup(), DiagnoseTwoPhaseLookup(), doesUsualArrayDeleteWantSize(), emitReplacement(), clang::Sema::FindAllocationFunctions(), getTupleLikeElementType(), HasNoThrowOperator(), hasUserDefinedMapper(), clang::Sema::isDeductionGuideName(), clang::Sema::isTagName(), clang::Sema::isTemplateName(), lookupMember(), clang::LookupNamed(), clang::LookupNamespace(), clang::SemaOpenMP::lookupOpenMPDeclareTargetName(), LookupPotentialTypoResult(), clang::SemaCodeCompletion::ProduceCallSignatureHelp(), resolveBuiltinNewDeleteOverload(), and clang::TypoCorrectionConsumer::TypoCorrectionConsumer().
◆ wasNotFoundInCurrentInstantiation()
bool clang::LookupResult::wasNotFoundInCurrentInstantiation ( ) const | inline |
---|
The documentation for this class was generated from the following files:
- include/clang/Sema/Lookup.h
- lib/Sema/SemaLookup.cpp