clang
3.9.0
|
Represents the results of name lookup. More...
#include <Lookup.h>
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, 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) | |
Creates a temporary lookup result, initializing its core data using the information from another result. More... | |
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. More... | |
void | setLookupNameInfo (const DeclarationNameInfo &NameInfo) |
Sets the name info to look up. More... | |
DeclarationName | getLookupName () const |
Gets the name to look up. More... | |
void | setLookupName (DeclarationName Name) |
Sets the name to look up. More... | |
Sema::LookupNameKind | getLookupKind () const |
Gets the kind of lookup to perform. More... | |
bool | isForRedeclaration () const |
True if this lookup is just looking for an existing declaration. More... | |
void | setAllowHidden (bool AH) |
Specify whether hidden declarations are visible, e.g., for recovery reasons. More... | |
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. More... | |
void | setHideTags (bool Hide) |
Sets whether tag declarations should be hidden by non-tag declarations during resolution. More... | |
bool | isAmbiguous () const |
bool | isSingleResult () const |
Determines if this names a single result which is not an unresolved value using decl. More... | |
bool | isOverloadedResult () const |
Determines if the results are overloaded. More... | |
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. More... | |
CXXBasePaths * | getBasePaths () const |
Return the base paths structure that's associated with these results, or null if none is. More... | |
NamedDecl * | getAcceptableDecl (NamedDecl *D) const |
Retrieve the accepted (re)declaration of the given declaration, if there is one. More... | |
unsigned | getIdentifierNamespace () const |
Returns the identifier namespace mask for this lookup. More... | |
bool | isClassLookup () const |
Returns whether these results arose from performing a lookup into a class. More... | |
CXXRecordDecl * | getNamingClass () const |
Returns the 'naming class' for this lookup, i.e. More... | |
void | setNamingClass (CXXRecordDecl *Record) |
Sets the 'naming class' for this lookup. More... | |
QualType | getBaseObjectType () const |
Returns the base object type associated with this lookup; important for [class.protected]. More... | |
void | setBaseObjectType (QualType T) |
Sets the base object type for this lookup. More... | |
void | addDecl (NamedDecl *D) |
Add a declaration to these results with its natural access. More... | |
void | addDecl (NamedDecl *D, AccessSpecifier AS) |
Add a declaration to these results with the given access. More... | |
void | addAllDecls (const LookupResult &Other) |
Add all the declarations from another set of lookup results. More... | |
bool | wasNotFoundInCurrentInstantiation () const |
Determine whether no result was found because we could not search into dependent base classes of the current instantiation. More... | |
void | setNotFoundInCurrentInstantiation () |
Note that while no result was found in the current instantiation, there were dependent base classes that could not be searched. More... | |
bool | isShadowed () const |
Determine whether the lookup result was shadowed by some other declaration that lookup ignored. More... | |
void | setShadowed () |
Note that we found and ignored a declaration while performing lookup. More... | |
void | resolveKind () |
Resolves the result kind of the lookup, possibly hiding decls. More... | |
void | resolveKindAfterFilter () |
Re-resolves the result kind of the lookup after a set of removals has been performed. More... | |
template<class DeclClass > | |
DeclClass * | getAsSingle () const |
NamedDecl * | getFoundDecl () const |
Fetch the unique decl found by this lookup. More... | |
NamedDecl * | getRepresentativeDecl () const |
Fetches a representative decl. Useful for lazy diagnostics. More... | |
bool | isSingleTagDecl () const |
Asks if the result is a single tag decl. More... | |
void | setAmbiguousBaseSubobjectTypes (CXXBasePaths &P) |
Make these results show that the name was found in base classes of different types. More... | |
void | setAmbiguousBaseSubobjects (CXXBasePaths &P) |
Make these results show that the name was found in distinct base classes of the same type. More... | |
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. More... | |
void | clear () |
Clears out any current state. More... | |
void | clear (Sema::LookupNameKind Kind) |
Clears out any current state and re-initializes for a different kind of lookup. More... | |
void | setRedeclarationKind (Sema::RedeclarationKind RK) |
Change this lookup's redeclaration kind. More... | |
void | dump () |
void | print (raw_ostream &) |
void | suppressDiagnostics () |
Suppress the diagnostics that would normally fire because of this lookup. More... | |
bool | isSuppressingDiagnostics () const |
Determines whether this lookup is suppressing diagnostics. More... | |
void | setContextRange (SourceRange SR) |
Sets a 'context' source range. More... | |
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. More... | |
SourceLocation | getNameLoc () const |
Gets the location of the identifier. More... | |
Sema & | getSema () const |
Get the Sema object that this lookup result is searching with. More... | |
Filter | makeFilter () |
Create a filter for this result set. More... | |
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. More... | |
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 30 of file Sema/Lookup.h.
Definition at line 127 of file Sema/Lookup.h.
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); // error: A::f and B::f come from subobjects of different
// types. overload resolution is not performed.
}
|
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. namespace A { struct Foo {}; }
namespace B { void Foo(); }
namespace C {
using namespace A;
using namespace B;
}
void test() {
C::Foo(); // error: tag 'A::Foo' is hidden by an object in a
// different namespace
}
|
Definition at line 60 of file Sema/Lookup.h.
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 32 of file Sema/Lookup.h.
A little identifier for flagging temporary lookup results.
Enumerator | |
---|---|
Temporary |
Definition at line 123 of file Sema/Lookup.h.
|
inline |
Definition at line 129 of file Sema/Lookup.h.
|
inline |
Definition at line 151 of file Sema/Lookup.h.
|
inline |
Creates a temporary lookup result, initializing its core data using the information from another result.
Diagnostics are always disabled.
Definition at line 173 of file Sema/Lookup.h.
|
delete |
|
inline |
Definition at line 193 of file Sema/Lookup.h.
|
inline |
Definition at line 231 of file Sema/Lookup.h.
|
inline |
Add all the declarations from another set of lookup results.
Definition at line 423 of file Sema/Lookup.h.
References clang::UnresolvedSetImpl::append(), clang::UnresolvedSetImpl::begin(), clang::UnresolvedSetImpl::end(), and Found.
Referenced by LookupQualifiedNameInUsingDirectives().
|
inline |
Add a declaration to these results with its natural access.
Does not test the acceptance criteria.
Definition at line 410 of file Sema/Lookup.h.
Referenced by clang::Sema::ActOnIdExpression(), clang::Sema::ActOnTag(), clang::Sema::ActOnUsingDirective(), clang::Sema::ActOnVarTemplateSpecialization(), clang::Sema::BuildCXXNestedNameSpecifier(), BuildImplicitMemberInitializer(), clang::Sema::BuildUsingDeclaration(), checkForConflictWithNonVisibleExternC(), clang::Sema::CheckFunctionDeclaration(), clang::Sema::CheckFunctionTemplateSpecialization(), checkGlobalOrExternCConflict(), clang::Sema::CheckImplicitSpecialMemberDeclaration(), clang::Sema::CheckMemberSpecialization(), clang::Sema::ClassifyName(), clang::Sema::DefineImplicitCopyAssignment(), clang::Sema::DefineImplicitMoveAssignment(), clang::Sema::DiagnoseEmptyLookup(), DiagnoseInvalidRedeclaration(), clang::Sema::InstantiateVariableDefinition(), LookupBuiltin(), LookupDirect(), clang::Sema::LookupInObjCMethod(), clang::Sema::LookupInSuper(), LookupMemberExprInRecord(), clang::Sema::LookupName(), LookupPotentialTypoResult(), clang::Sema::LookupTemplateName(), clang::TreeTransform< Derived >::RebuildMemberExpr(), and TryNamespaceTypoCorrection().
|
inline |
Add a declaration to these results with the given access.
Does not test the acceptance criteria.
Definition at line 416 of file Sema/Lookup.h.
References clang::UnresolvedSetImpl::addDecl(), and Found.
|
inline |
Definition at line 315 of file Sema/Lookup.h.
Referenced by clang::Sema::BuildLiteralOperatorCall(), clang::Sema::CheckDependentFunctionTemplateSpecialization(), and clang::Sema::CodeCompleteCall().
|
inline |
Definition at line 319 of file Sema/Lookup.h.
References clang::UnresolvedSetImpl::begin().
Referenced by clang::Sema::ActOnExplicitInstantiation(), clang::Sema::ActOnIdExpression(), clang::Sema::AddMemberOperatorCandidates(), clang::Sema::BuildCallToObjectOfClassType(), clang::Sema::BuildDeclarationNameExpr(), buildDeclareReductionRef(), clang::Sema::BuildMemberReferenceExpr(), clang::Sema::BuildOverloadedArrowExpr(), clang::Sema::BuildQualifiedDeclarationNameExpr(), buildSingleCopyAssignRecursively(), clang::Sema::BuildTemplateIdExpr(), clang::Sema::BuildUsingDeclaration(), clang::Sema::CheckClassTemplate(), clang::Sema::CheckFunctionTemplateSpecialization(), checkGlobalOrExternCConflict(), 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(), DiagnoseInvalidRedeclaration(), DiagnoseTwoPhaseLookup(), clang::Sema::FindAllocationFunctions(), clang::Sema::FindAllocationOverload(), clang::Sema::FindDeallocationFunction(), clang::Sema::FindUsualDeallocationFunction(), getFoundDecl(), getRepresentativeDecl(), clang::Sema::getTypeName(), clang::Sema::hasAnyAcceptableTemplateNames(), HasNoThrowOperator(), isResultTypeOrTemplate(), isTagTypeWithMissingTag(), clang::Sema::LookupLiteralOperator(), clang::Sema::LookupOverloadedOperatorName(), and clang::LookupResult::Filter::restart().
|
inline |
Clears out any current state.
Definition at line 538 of file Sema/Lookup.h.
References clang::UnresolvedSetImpl::clear(), and NotFound.
Referenced by clang::Sema::ActOnAliasDeclaration(), clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::ActOnIdExpression(), clang::Sema::ActOnNamespaceAliasDef(), clang::Sema::ActOnTag(), clang::Sema::ActOnTypedefDeclarator(), clang::Sema::ActOnUsingDirective(), clang::Sema::ActOnVariableDeclarator(), clang::Sema::BuildCXXNestedNameSpecifier(), buildDeclareReductionRef(), clang::Sema::BuildMemInitializer(), clang::Sema::CheckClassTemplate(), checkForConflictWithNonVisibleExternC(), clang::Sema::CheckFunctionDeclaration(), clang::Sema::CheckFunctionTemplateSpecialization(), checkGlobalOrExternCConflict(), clang::Sema::CheckMemberSpecialization(), clang::Sema::ClassifyName(), clear(), clang::Sema::DiagnoseEmptyLookup(), DiagnoseInvalidRedeclaration(), DiagnoseTwoPhaseLookup(), clang::Sema::getDestructorName(), clang::Sema::HandleDeclarator(), isTagTypeWithMissingTag(), LookupMemberExprInRecord(), LookupPotentialTypoResult(), LookupQualifiedNameInUsingDirectives(), clang::Sema::LookupTemplateName(), TryNamespaceTypoCorrection(), and clang::TemplateDeclInstantiator::VisitCXXMethodDecl().
|
inline |
Clears out any current state and re-initializes for a different kind of lookup.
Definition at line 549 of file Sema/Lookup.h.
References clear().
LLVM_DUMP_METHOD void LookupResult::dump | ( | ) |
Definition at line 664 of file SemaLookup.cpp.
Referenced by clang::Sema::ActOnPragmaDump().
|
inline |
Return true if no decls were found.
Definition at line 323 of file Sema/Lookup.h.
References clang::UnresolvedSetImpl::empty().
Referenced by clang::Sema::ActOnAliasDeclaration(), clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnIdExpression(), clang::Sema::ActOnNamespaceAliasDef(), clang::Sema::ActOnOpenMPIdExpression(), clang::Sema::ActOnStartOfLambdaDefinition(), clang::Sema::ActOnTag(), clang::Sema::ActOnTypedefNameDecl(), clang::Sema::ActOnUsingDirective(), clang::Sema::ActOnVariableDeclarator(), clang::Sema::BuildCXXNestedNameSpecifier(), clang::Sema::BuildForRangeBeginEndCall(), clang::Sema::BuildImplicitMemberExpr(), clang::Sema::BuildMemberReferenceExpr(), clang::Sema::BuildMemInitializer(), BuildNonArrayForRange(), 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(), DiagnoseTwoPhaseLookup(), doesUsualArrayDeleteWantSize(), filterNonConflictingPreviousTypedefDecls(), clang::Sema::FindAllocationFunctions(), clang::Sema::FindAllocationOverload(), clang::Sema::FindDeallocationFunction(), clang::Sema::getTypeName(), clang::Sema::LookupInObjCMethod(), clang::Sema::LookupInSuper(), LookupMemberExprInRecord(), LookupPotentialTypoResult(), LookupQualifiedNameInUsingDirectives(), clang::Sema::LookupTemplateName(), clang::MultiplexExternalSemaSource::LookupUnqualified(), and clang::TemplateDeclInstantiator::VisitCXXMethodDecl().
|
inline |
Definition at line 320 of file Sema/Lookup.h.
References clang::UnresolvedSetImpl::end().
Referenced by clang::Sema::ActOnExplicitInstantiation(), clang::Sema::AddMemberOperatorCandidates(), clang::Sema::BuildCallToObjectOfClassType(), clang::Sema::BuildDeclarationNameExpr(), buildDeclareReductionRef(), clang::Sema::BuildMemberReferenceExpr(), clang::Sema::BuildOverloadedArrowExpr(), buildSingleCopyAssignRecursively(), clang::Sema::BuildTemplateIdExpr(), clang::Sema::BuildUsingDeclaration(), clang::Sema::CheckClassTemplate(), clang::Sema::CheckFunctionTemplateSpecialization(), checkGlobalOrExternCConflict(), clang::Sema::CheckLookupAccess(), clang::Sema::CheckMemberSpecialization(), clang::Sema::CheckOverload(), clang::Sema::CheckQualifiedMemberReference(), clang::Sema::CheckUsingDeclRedeclaration(), clang::Sema::CheckUsingShadowDecl(), clang::Sema::ClassifyName(), DiagnoseInvalidRedeclaration(), DiagnoseTwoPhaseLookup(), clang::Sema::FindAllocationFunctions(), clang::Sema::FindAllocationOverload(), clang::Sema::FindDeallocationFunction(), clang::Sema::FindUsualDeallocationFunction(), clang::Sema::getTypeName(), clang::Sema::hasAnyAcceptableTemplateNames(), clang::LookupResult::Filter::hasNext(), HasNoThrowOperator(), isResultTypeOrTemplate(), isTagTypeWithMissingTag(), clang::Sema::LookupLiteralOperator(), clang::Sema::LookupOverloadedOperatorName(), clang::Sema::maybeAddCUDAHostDeviceAttrs(), and clang::LookupResult::Filter::next().
Retrieve the accepted (re)declaration of the given declaration, if there is one.
Definition at line 345 of file Sema/Lookup.h.
References getSema(), isHiddenDeclarationVisible(), and isVisible().
Referenced by clang::Sema::CheckImplicitSpecialMemberDeclaration(), LookupDirect(), clang::Sema::LookupName(), and LookupVisibleDecls().
|
inline |
Definition at line 310 of file Sema/Lookup.h.
References isAmbiguous().
Referenced by clang::Sema::DiagnoseAmbiguousLookup(), and clang::Sema::getTypeName().
|
inline |
Definition at line 491 of file Sema/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::ActOnOpenMPDeclareTargetName(), clang::Sema::ActOnOpenMPIdExpression(), clang::Sema::ActOnStartOfLambdaDefinition(), clang::Sema::ActOnUsingDirective(), clang::Sema::BuildBuiltinOffsetOf(), clang::Sema::BuildCXXNestedNameSpecifier(), clang::Sema::BuildDeclarationNameExpr(), clang::Sema::BuildMemInitializer(), clang::Sema::BuildQualifiedDeclarationNameExpr(), clang::Sema::BuildQualifiedTemplateIdExpr(), clang::Sema::BuildTemplateIdExpr(), clang::Sema::BuildUsingDeclaration(), clang::Sema::CheckTemplateTypeArgument(), clang::Sema::CheckUsingDeclQualifier(), clang::Sema::ClassifyName(), clang::Sema::getDestructorName(), clang::Sema::HandleField(), clang::Sema::HandleMSProperty(), clang::Sema::isNonTypeNestedNameSpecifier(), clang::Sema::isTagName(), isTagTypeWithMissingTag(), clang::Sema::LookupSingleName(), clang::Sema::MergeTypedefNameDecl(), and clang::TreeTransform< Derived >::RebuildDependentNameType().
|
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 399 of file Sema/Lookup.h.
Referenced by clang::Sema::CheckLookupAccess().
|
inline |
Return the base paths structure that's associated with these results, or null if none is.
Definition at line 327 of file Sema/Lookup.h.
Referenced by clang::Sema::DiagnoseAmbiguousLookup().
|
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 583 of file Sema/Lookup.h.
Referenced by clang::Sema::DiagnoseAmbiguousLookup().
|
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 501 of file Sema/Lookup.h.
References begin(), Found, and getResultKind().
Referenced by clang::Sema::ActOnAliasDeclaration(), clang::Sema::ActOnIdExpression(), clang::Sema::ActOnMethodDeclaration(), clang::Sema::ActOnNamespaceAliasDef(), clang::Sema::ActOnOpenMPIdExpression(), clang::Sema::ActOnSizeofParameterPackExpr(), clang::Sema::ActOnTag(), clang::Sema::ActOnVariableDeclarator(), AllowOverloadingOfFunction(), clang::Sema::BuildDeclarationNameExpr(), clang::Sema::BuildMemberReferenceExpr(), clang::Sema::BuildUsingDeclaration(), clang::Sema::CheckFunctionDeclaration(), clang::Sema::CheckMemberSpecialization(), CheckObjCBridgeCFCast(), CheckObjCBridgeNSCast(), clang::Sema::checkObjCBridgeRelatedComponents(), 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(), and clang::Sema::MergeVarDecl().
|
inline |
Returns the identifier namespace mask for this lookup.
Definition at line 361 of file Sema/Lookup.h.
|
inline |
Gets the kind of lookup to perform.
Definition at line 257 of file Sema/Lookup.h.
Referenced by clang::Sema::ActOnSizeofParameterPackExpr(), attemptRecovery(), clang::Sema::BuildCXXNestedNameSpecifier(), clang::Sema::BuildMemInitializer(), clang::Sema::BuildUsingDeclaration(), clang::Sema::CheckOverload(), clang::Sema::ClassifyName(), clang::Sema::DiagnoseEmptyLookup(), clang::Sema::getObjCMessageKind(), LookupBuiltin(), clang::Sema::LookupInSuper(), LookupMemberExprInRecord(), clang::Sema::LookupName(), clang::Sema::LookupQualifiedName(), clang::Sema::LookupTemplateName(), and TryNamespaceTypoCorrection().
|
inline |
Gets the name to look up.
Definition at line 247 of file Sema/Lookup.h.
References clang::DeclarationNameInfo::getName().
Referenced by clang::Sema::BuildCXXNestedNameSpecifier(), clang::Sema::BuildLiteralOperatorCall(), clang::Sema::CheckShadow(), clang::Sema::DiagnoseAmbiguousLookup(), clang::Sema::DiagnoseEmptyLookup(), DiagnoseTwoPhaseLookup(), clang::Sema::getTypeName(), LookupBuiltin(), LookupDirect(), clang::Sema::LookupLiteralOperator(), LookupMemberExpr(), LookupMemberExprInRecord(), clang::Sema::LookupName(), clang::Sema::LookupQualifiedName(), clang::Sema::LookupTemplateName(), and LookupVisibleDecls().
|
inline |
Gets the name info to look up.
Definition at line 237 of file Sema/Lookup.h.
Referenced by clang::Sema::ActOnSizeofParameterPackExpr(), attemptRecovery(), clang::Sema::BuildCXXNestedNameSpecifier(), clang::Sema::BuildDeclarationNameExpr(), clang::Sema::BuildMemberReferenceExpr(), clang::Sema::BuildMemInitializer(), clang::Sema::BuildPossibleImplicitMemberExpr(), clang::Sema::BuildTemplateIdExpr(), clang::Sema::BuildUsingDeclaration(), clang::Sema::CheckQualifiedMemberReference(), clang::Sema::ClassifyName(), clang::Sema::DiagnoseEmptyLookup(), clang::Sema::getObjCMessageKind(), clang::Sema::getTypeName(), clang::Sema::LookupInSuper(), LookupMemberExpr(), LookupMemberExprInRecord(), clang::Sema::LookupTemplateName(), and TryNamespaceTypoCorrection().
|
inline |
Gets the location of the identifier.
This isn't always defined: sometimes we're doing lookups on synthesized names.
Definition at line 589 of file Sema/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::CheckLookupAccess(), clang::Sema::CheckShadow(), clang::Sema::DiagnoseAmbiguousLookup(), clang::Sema::DiagnoseEmptyLookup(), DiagnoseTwoPhaseLookup(), LookupBuiltin(), LookupDirect(), clang::Sema::LookupInObjCMethod(), clang::Sema::LookupLiteralOperator(), LookupMemberExpr(), LookupMemberExprInRecord(), clang::Sema::LookupTemplateName(), and LookupVisibleDecls().
|
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 387 of file Sema/Lookup.h.
Referenced by clang::Sema::BuildDeclarationNameExpr(), clang::Sema::BuildTemplateIdExpr(), clang::Sema::CheckLookupAccess(), clang::Sema::FindAllocationFunctions(), clang::Sema::FindAllocationOverload(), and clang::Sema::FindDeallocationFunction().
|
inline |
Fetches a representative decl. Useful for lazy diagnostics.
Definition at line 508 of file Sema/Lookup.h.
References begin(), and clang::UnresolvedSetImpl::empty().
Referenced by clang::Sema::ActOnAliasDeclaration(), clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnNamespaceAliasDef(), clang::Sema::ActOnStartNamespaceDef(), clang::Sema::ActOnTag(), clang::Sema::ActOnUsingDirective(), clang::Sema::ActOnVariableDeclarator(), clang::Sema::BuildCXXNestedNameSpecifier(), clang::Sema::BuildDeclarationNameExpr(), buildDeclareReductionRef(), clang::Sema::BuildPossibleImplicitMemberExpr(), CheckAnonMemberRedeclaration(), clang::Sema::CheckClassTemplate(), clang::Sema::CheckFunctionDeclaration(), clang::Sema::CheckMemberSpecialization(), clang::Sema::CheckQualifiedMemberReference(), clang::Sema::CheckTypenameType(), clang::Sema::HandleField(), clang::Sema::HandleMSProperty(), clang::Sema::LookupTemplateName(), clang::Sema::MergeTypedefNameDecl(), clang::Sema::MergeVarDecl(), and clang::TreeTransform< Derived >::RebuildDependentNameType().
|
inline |
Definition at line 305 of file Sema/Lookup.h.
Referenced by clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnIdExpression(), clang::Sema::ActOnSizeofParameterPackExpr(), AllowOverloadingOfFunction(), clang::Sema::BuildQualifiedDeclarationNameExpr(), clang::Sema::CheckMicrosoftIfExistsSymbol(), clang::Sema::CheckShadow(), clang::Sema::CheckTemplateTypeArgument(), clang::Sema::CheckTypenameType(), clang::Sema::ClassifyName(), getAsSingle(), getFoundDecl(), clang::Sema::getObjCMessageKind(), clang::Sema::getTypeName(), clang::Sema::HandleField(), clang::Sema::HandleMSProperty(), isAmbiguous(), isOverloadedResult(), isSingleResult(), isSingleTagDecl(), clang::Sema::isTagName(), isUnresolvableResult(), clang::Sema::LookupLiteralOperator(), and clang::TreeTransform< Derived >::RebuildDependentNameType().
|
inline |
Get the Sema object that this lookup result is searching with.
Definition at line 595 of file Sema/Lookup.h.
Referenced by getAcceptableDecl(), isResultTypeOrTemplate(), LookupDirect(), LookupMemberExprInRecord(), and LookupVisibleDecls().
|
inline |
Definition at line 285 of file Sema/Lookup.h.
References Ambiguous, and getResultKind().
Referenced by clang::Sema::ActOnExplicitInstantiation(), clang::Sema::ActOnIdExpression(), clang::Sema::ActOnNamespaceAliasDef(), clang::Sema::ActOnOpenMPDeclareTargetName(), clang::Sema::ActOnOpenMPIdExpression(), clang::Sema::ActOnStartOfLambdaDefinition(), clang::Sema::ActOnTag(), clang::Sema::ActOnUsingDirective(), 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::CheckClassTemplate(), clang::Sema::ClassifyName(), clang::Sema::DiagnoseAmbiguousLookup(), doesUsualArrayDeleteWantSize(), clang::Sema::FindAllocationFunctions(), clang::Sema::FindAllocationOverload(), clang::Sema::FindDeallocationFunction(), getAmbiguityKind(), clang::Sema::getDestructorName(), and clang::Sema::LookupOverloadedOperatorName().
|
inline |
Returns whether these results arose from performing a lookup into a class.
Definition at line 367 of file Sema/Lookup.h.
|
inline |
True if this lookup is just looking for an existing declaration.
Definition at line 262 of file Sema/Lookup.h.
Referenced by clang::Sema::ActOnTag(), isHiddenDeclarationVisible(), LookupBuiltin(), LookupDirect(), clang::Sema::LookupInObjCMethod(), LookupMemberExprInRecord(), and clang::Sema::LookupQualifiedName().
Determine whether this lookup is permitted to see hidden declarations, such as those in modules that have not yet been imported.
Definition at line 274 of file Sema/Lookup.h.
References clang::NamedDecl::isExternallyVisible(), and isForRedeclaration().
Referenced by getAcceptableDecl().
|
inline |
Determines if the results are overloaded.
Definition at line 297 of file Sema/Lookup.h.
References FoundOverloaded, and getResultKind().
Referenced by clang::Sema::ActOnIdExpression(), clang::Sema::BuildDeclarationNameExpr(), and clang::Sema::BuildMemberReferenceExpr().
|
inline |
Determine whether the lookup result was shadowed by some other declaration that lookup ignored.
Definition at line 443 of file Sema/Lookup.h.
Referenced by clang::Sema::ActOnVariableDeclarator(), clang::Sema::CheckFunctionDeclaration(), and mergeTypeWithPrevious().
|
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 292 of file Sema/Lookup.h.
References Found, and getResultKind().
Referenced by clang::Sema::ActOnAliasDeclaration(), clang::Sema::ActOnMethodDeclaration(), clang::Sema::ActOnNamespaceAliasDef(), clang::Sema::ActOnOpenMPDeclareTargetName(), clang::Sema::ActOnOpenMPIdExpression(), clang::Sema::ActOnStartNamespaceDef(), clang::Sema::ActOnTag(), clang::Sema::ActOnVariableDeclarator(), clang::Sema::BuildCXXNestedNameSpecifier(), clang::Sema::BuildDeclarationNameExpr(), clang::Sema::BuildMemberReferenceExpr(), clang::Sema::CheckMemberSpecialization(), doesUsualArrayDeleteWantSize(), clang::Sema::HandleDeclarator(), clang::Sema::LookupInObjCMethod(), LookupPotentialTypoResult(), clang::Sema::LookupTemplateName(), and clang::Sema::MergeVarDecl().
|
inline |
Asks if the result is a single tag decl.
Definition at line 514 of file Sema/Lookup.h.
References Found, getFoundDecl(), and getResultKind().
Referenced by clang::Sema::HandleDeclarator(), LookupQualifiedNameInUsingDirectives(), and clang::TemplateDeclInstantiator::VisitCXXMethodDecl().
|
inline |
Determines whether this lookup is suppressing diagnostics.
Definition at line 571 of file Sema/Lookup.h.
Referenced by clang::Sema::LookupTemplateName().
|
inline |
Definition at line 301 of file Sema/Lookup.h.
References FoundUnresolvedValue, and getResultKind().
Referenced by clang::Sema::ActOnIdExpression(), clang::Sema::BuildMemberReferenceExpr(), and ClassifyImplicitMemberAccess().
Determine whether the given declaration is visible to the program.
Definition at line 333 of file Sema/Lookup.h.
References clang::NamedDecl::isHidden().
Referenced by checkCorrectionVisibility(), findAcceptableDecl(), clang::TypoCorrectionConsumer::FoundDecl(), getAcceptableDecl(), and clang::Sema::MergeCXXFunctionDecl().
|
inline |
Create a filter for this result set.
Definition at line 665 of file Sema/Lookup.h.
Referenced by clang::Sema::ActOnFriendFunctionDecl(), clang::Sema::ActOnOpenMPDeclareReductionDirectiveStart(), clang::Sema::ActOnTag(), buildSingleCopyAssignRecursively(), clang::Sema::BuildUsingDeclaration(), clang::Sema::CheckDependentFunctionTemplateSpecialization(), doesUsualArrayDeleteWantSize(), clang::Sema::FilterAcceptableTemplateNames(), clang::Sema::FilterLookupForScope(), filterNonConflictingPreviousTypedefDecls(), clang::Sema::LookupLiteralOperator(), and RemoveUsingDecls().
|
delete |
|
inline |
Definition at line 209 of file Sema/Lookup.h.
void LookupResult::print | ( | raw_ostream & | Out | ) |
Definition at line 653 of file SemaLookup.cpp.
References clang::begin(), E, clang::end(), and I.
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 470 of file SemaLookup.cpp.
References AmbiguousReference, canHideTag(), Context, Found, FoundOverloaded, FoundUnresolvedValue, clang::ASTContext::getCanonicalType(), getContextForScopeMatching(), clang::NamedDecl::getUnderlyingDecl(), I, and isPreferredLookupResult().
Referenced by clang::Sema::ActOnTag(), clang::Sema::ActOnUsingDirective(), clang::Sema::BuildUsingDeclaration(), clang::Sema::CheckImplicitSpecialMemberDeclaration(), clang::Sema::ClassifyName(), CppNamespaceLookup(), clang::Sema::LookupInSuper(), LookupMemberExprInRecord(), clang::Sema::LookupName(), LookupPotentialTypoResult(), clang::Sema::LookupQualifiedName(), LookupQualifiedNameInUsingDirectives(), clang::TreeTransform< Derived >::RebuildMemberExpr(), and resolveKindAfterFilter().
|
inline |
Re-resolves the result kind of the lookup after a set of removals has been performed.
Definition at line 458 of file Sema/Lookup.h.
References Ambiguous, clang::UnresolvedSetImpl::empty(), Found, NotFound, NotFoundInCurrentInstantiation, and resolveKind().
Referenced by clang::LookupResult::Filter::done().
|
inline |
Specify whether hidden declarations are visible, e.g., for recovery reasons.
Definition at line 268 of file Sema/Lookup.h.
Referenced by LookupPotentialTypoResult(), and clang::Sema::LookupVisibleDecls().
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 637 of file SemaLookup.cpp.
References clang::CXXBasePaths::swap().
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 645 of file SemaLookup.cpp.
References clang::CXXBasePaths::swap().
|
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 533 of file Sema/Lookup.h.
References AmbiguousTagHiding.
Referenced by LookupQualifiedNameInUsingDirectives().
|
inline |
Sets the base object type for this lookup.
Definition at line 404 of file Sema/Lookup.h.
Referenced by clang::Sema::BuildMemberReferenceExpr(), and clang::Sema::BuildUsingDeclaration().
|
inline |
Sets a 'context' source range.
Definition at line 576 of file Sema/Lookup.h.
Referenced by clang::Sema::BuildCXXNestedNameSpecifier(), clang::Sema::isNonTypeNestedNameSpecifier(), and clang::Sema::LookupParsedName().
|
inline |
Definition at line 669 of file Sema/Lookup.h.
|
inline |
Sets whether tag declarations should be hidden by non-tag declarations during resolution.
The default is true.
Definition at line 281 of file Sema/Lookup.h.
Referenced by clang::Sema::ActOnPragmaDump(), clang::Sema::BuildUsingDeclaration(), and clang::Sema::CheckUsingDeclQualifier().
|
inline |
Sets the name to look up.
Definition at line 252 of file Sema/Lookup.h.
References clang::DeclarationNameInfo::setName().
Referenced by clang::Sema::BuildCXXNestedNameSpecifier(), clang::Sema::BuildMemInitializer(), clang::Sema::ClassifyName(), clang::Sema::DiagnoseEmptyLookup(), DiagnoseInvalidRedeclaration(), LookupMemberExprInRecord(), LookupPotentialTypoResult(), and clang::Sema::LookupTemplateName().
|
inline |
Sets the name info to look up.
Definition at line 242 of file Sema/Lookup.h.
|
inline |
Sets the 'naming class' for this lookup.
Definition at line 392 of file Sema/Lookup.h.
Referenced by clang::Sema::DiagnoseEmptyLookup(), clang::Sema::LookupInSuper(), and clang::Sema::LookupQualifiedName().
|
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 436 of file Sema/Lookup.h.
References clang::UnresolvedSetImpl::empty(), NotFound, and NotFoundInCurrentInstantiation.
Referenced by clang::Sema::LookupParsedName(), and clang::Sema::LookupQualifiedName().
|
inline |
Change this lookup's redeclaration kind.
Definition at line 556 of file Sema/Lookup.h.
Referenced by clang::Sema::ActOnTag().
|
inline |
Note that we found and ignored a declaration while performing lookup.
Definition at line 447 of file Sema/Lookup.h.
Referenced by clang::Sema::CheckVariableDeclaration(), and clang::Sema::LookupName().
|
inline |
Suppress the diagnostics that would normally fire because of this lookup.
This happens during (e.g.) redeclaration lookups.
Definition at line 566 of file Sema/Lookup.h.
Referenced by clang::Sema::ActOnOpenMPDeclareTargetName(), clang::Sema::ActOnOpenMPIdExpression(), clang::Sema::ActOnPragmaDump(), clang::Sema::AddMemberOperatorCandidates(), clang::Sema::BuildCallToObjectOfClassType(), clang::Sema::BuildDeclarationNameExpr(), buildDeclareReductionRef(), clang::Sema::BuildMemberReferenceExpr(), clang::Sema::BuildMemInitializer(), clang::Sema::BuildOverloadedArrowExpr(), clang::Sema::BuildTemplateIdExpr(), clang::Sema::BuildUsingDeclaration(), clang::Sema::CheckImplicitSpecialMemberDeclaration(), clang::Sema::CheckMicrosoftIfExistsSymbol(), clang::Sema::CheckUsingDeclQualifier(), clang::Sema::ClassifyName(), clang::Sema::CodeCompleteCall(), CXXRecordMembersNamed(), clang::Sema::DiagnoseEmptyLookup(), DiagnoseTwoPhaseLookup(), doesUsualArrayDeleteWantSize(), clang::Sema::FindAllocationFunctions(), clang::Sema::FindAllocationOverload(), clang::Sema::FindDeallocationFunction(), clang::Sema::getObjCMessageKind(), clang::Sema::getTypeName(), clang::Sema::HandleField(), HasNoThrowOperator(), clang::Sema::isNonTypeNestedNameSpecifier(), clang::Sema::isTagName(), LookupMemberExprInRecord(), LookupPotentialTypoResult(), and clang::TypoCorrectionConsumer::TypoCorrectionConsumer().
|
inline |
Determine whether no result was found because we could not search into dependent base classes of the current instantiation.
Definition at line 430 of file Sema/Lookup.h.
References NotFoundInCurrentInstantiation.
Referenced by clang::Sema::ActOnTag().