23 #include "llvm/ADT/STLExtras.h" 24 using namespace clang;
33 if (
const RecordType *RecordTy = dyn_cast<RecordType>(Ty)) {
34 CXXRecordDecl *Record = cast<CXXRecordDecl>(RecordTy->getDecl());
40 }
else if (isa<InjectedClassNameType>(Ty))
41 return cast<InjectedClassNameType>(Ty)->getDecl();
56 return Tag->getDecl();
75 bool EnteringContext) {
86 if (EnteringContext) {
100 = dyn_cast_or_null<ClassTemplateDecl>(
101 SpecType->getTemplateName().getAsTemplateDecl())) {
109 = ClassTemplate->getInjectedClassNameSpecialization();
111 return ClassTemplate->getTemplatedDecl();
118 = ClassTemplate->findPartialSpecialization(ContextType)) {
123 "partial specialization scope specifier in SFINAE context?");
133 return RecordT->getDecl();
142 llvm_unreachable(
"Dependent nested-name-specifier has no DeclContext");
153 assert(Tag &&
"Non-tag type in nested-name-specifier");
164 llvm_unreachable(
"Invalid NestedNameSpecifier::Kind!");
181 assert(NNS->
isDependent() &&
"Only dependent nested-name-specifier allowed");
201 assert(DC &&
"given null context");
233 auto *EnumD = dyn_cast<
EnumDecl>(tag);
236 if (EnumD->isCompleteDefinition()) {
246 return !TreatAsComplete;
266 Diag(loc, diag::err_incomplete_nested_name_spec)
283 if (S->isFunctionScope()) {
284 if (
CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(S->getEntity()))
288 if (S->isClassScope()) {
289 RD = cast<CXXRecordDecl>(S->getEntity());
295 Diag(SuperLoc, diag::err_invalid_super_scope);
298 Diag(SuperLoc, diag::err_super_in_lambda_unsupported);
301 Diag(SuperLoc, diag::err_no_base_classes) << RD->
getName();
322 if (isa<NamespaceDecl>(SD))
325 if (!isa<TypeDecl>(SD))
334 if (TD->getUnderlyingType()->isRecordType())
336 if (TD->getUnderlyingType()->isEnumeralType()) {
342 }
else if (isa<RecordDecl>(SD)) {
344 }
else if (isa<EnumDecl>(SD)) {
371 assert(!Found.isAmbiguous() &&
"Cannot handle ambiguities here yet");
373 if (!Found.isSingleResult())
391 bool isDependent =
false;
392 if (!ObjectType.
isNull()) {
395 assert(!SS.
isSet() &&
"ObjectType and scope specifier cannot coexist");
398 }
else if (SS.
isSet()) {
418 }
else if (isDependent) {
432 class NestedNameSpecifierValidatorCCC final
435 explicit NestedNameSpecifierValidatorCCC(
Sema &SRef)
438 bool ValidateCandidate(
const TypoCorrection &candidate)
override {
442 std::unique_ptr<CorrectionCandidateCallback> clone()
override {
443 return llvm::make_unique<NestedNameSpecifierValidatorCCC>(*this);
486 bool ErrorRecoveryLookup,
487 bool *IsCorrectedToColon,
488 bool OnlyNamespace) {
498 bool isDependent =
false;
499 if (IsCorrectedToColon)
500 *IsCorrectedToColon =
false;
501 if (!ObjectType.
isNull()) {
504 assert(!SS.
isSet() &&
"ObjectType and scope specifier cannot coexist");
507 }
else if (SS.
isSet()) {
515 bool ObjectTypeSearchedInScope =
false;
552 else if (ScopeLookupResult)
553 Found.
addDecl(ScopeLookupResult);
555 ObjectTypeSearchedInScope =
true;
557 }
else if (!isDependent) {
567 if (Found.
empty() && isDependent &&
568 !(LookupCtx && LookupCtx->
isRecord() &&
570 !cast<CXXRecordDecl>(LookupCtx)->hasAnyDependentBases()))) {
572 if (ErrorRecoveryLookup)
583 if (Found.
empty() && !ErrorRecoveryLookup) {
589 else if (S && !isDependent)
593 R.suppressDiagnostics();
596 if (IsCorrectedToColon) {
597 *IsCorrectedToColon =
true;
598 Diag(IdInfo.
CCLoc, diag::err_nested_name_spec_is_not_class)
602 Diag(ND->getLocation(), diag::note_declared_at);
606 Diag(R.getNameLoc(), OnlyNamespace
607 ? unsigned(diag::err_expected_namespace_name)
608 : unsigned(diag::err_expected_class_or_namespace))
611 Diag(ND->getLocation(), diag::note_entity_declared_at)
622 NestedNameSpecifierValidatorCCC CCC(*
this);
627 bool DroppedSpecifier =
628 Corrected.WillReplaceSpecifier() &&
630 if (DroppedSpecifier)
633 << Name << LookupCtx << DroppedSpecifier
639 if (Corrected.getCorrectionSpecifier())
640 SS.MakeTrivial(
Context, Corrected.getCorrectionSpecifier(),
643 if (
NamedDecl *ND = Corrected.getFoundDecl())
653 bool IsExtension =
false;
655 if (!AcceptSpec && IsExtension) {
660 if (!ObjectType.
isNull() && !ObjectTypeSearchedInScope &&
675 LookupNestedNameSpecifierName);
679 OuterDecl = ScopeLookupResult;
683 (!isa<TypeDecl>(OuterDecl) || !isa<TypeDecl>(SD) ||
687 if (ErrorRecoveryLookup)
691 diag::err_nested_name_member_ref_lookup_ambiguous)
702 if (
auto *TD = dyn_cast_or_null<TypedefNameDecl>(SD))
707 if (ErrorRecoveryLookup)
713 if (
NamespaceDecl *Namespace = dyn_cast<NamespaceDecl>(SD)) {
726 if (isa<InjectedClassNameType>(T)) {
730 }
else if (isa<RecordType>(T)) {
733 }
else if (isa<TypedefType>(T)) {
736 }
else if (isa<EnumType>(T)) {
739 }
else if (isa<TemplateTypeParmType>(T)) {
743 }
else if (isa<UnresolvedUsingType>(T)) {
747 }
else if (isa<SubstTemplateTypeParmType>(T)) {
751 }
else if (isa<SubstTemplateTypeParmPackType>(T)) {
756 llvm_unreachable(
"Unhandled TypeDecl node in nested-name-specifier");
769 if (ErrorRecoveryLookup)
803 diag::ext_undeclared_unqual_id_with_dependent_base)
812 if (!Found.
empty()) {
820 Diag(ND->getLocation(), diag::note_entity_declared_at)
823 }
else if (SS.
isSet())
835 bool ErrorRecoveryLookup,
836 bool *IsCorrectedToColon,
837 bool OnlyNamespace) {
843 IsCorrectedToColon, OnlyNamespace);
858 if (!T->isDependentType() && !T->getAs<
TagType>()) {
880 bool EnteringContext) {
897 bool EnteringContext) {
927 for (
unsigned I = 0, N = TemplateArgs.
size(); I != N; ++I)
943 isa<FunctionTemplateDecl>(TD) || isa<VarTemplateDecl>(TD)) {
948 Diag(CCLoc, diag::err_non_type_template_in_nested_name_specifier)
949 << (TD && isa<VarTemplateDecl>(TD)) << Template << R;
963 Diag(TemplateNameLoc, diag::err_nested_name_spec_non_tag) << T;
976 for (
unsigned I = 0, N = TemplateArgs.
size(); I != N; ++I)
988 struct NestedNameSpecifierAnnotation {
998 (
sizeof(NestedNameSpecifierAnnotation) + SS.
location_size()),
999 alignof(NestedNameSpecifierAnnotation));
1000 NestedNameSpecifierAnnotation *Annotation
1001 =
new (Mem) NestedNameSpecifierAnnotation;
1010 if (!AnnotationPtr) {
1015 NestedNameSpecifierAnnotation *Annotation
1016 =
static_cast<NestedNameSpecifierAnnotation *
>(AnnotationPtr);
1021 assert(SS.
isSet() &&
"Parser passed invalid CXXScopeSpec.");
1044 switch (Qualifier->
getKind()) {
1060 llvm_unreachable(
"Invalid NestedNameSpecifier::Kind!");
1070 assert(SS.
isSet() &&
"Parser passed invalid CXXScopeSpec.");
1075 if (!DC)
return true;
1097 assert(SS.
isSet() &&
"Parser passed invalid CXXScopeSpec.");
1101 "exiting declarator scope we never really entered");
NamedDecl * FindFirstQualifierInScope(Scope *S, NestedNameSpecifier *NNS)
If the given nested-name-specifier begins with a bare identifier (e.g., Base::), perform name lookup ...
Defines the clang::ASTContext interface.
SourceLocation getLastQualifierNameLoc() const
Retrieve the location of the name in the last qualifier in this nested name specifier.
void MakeSuper(ASTContext &Context, CXXRecordDecl *RD, SourceLocation SuperLoc, SourceLocation ColonColonLoc)
Turns this (empty) nested-name-specifier into '__super' nested-name-specifier.
A (possibly-)qualified type.
Keeps information about an identifier in a nested-name-spec.
Simple class containing the result of Sema::CorrectTypo.
NestedNameSpecifier * getQualifier() const
Return the nested name specifier that qualifies this name.
unsigned getNumBases() const
Retrieves the number of base classes of this class.
bool ActOnCXXNestedNameSpecifier(Scope *S, NestedNameSpecInfo &IdInfo, bool EnteringContext, CXXScopeSpec &SS, bool ErrorRecoveryLookup=false, bool *IsCorrectedToColon=nullptr, bool OnlyNamespace=false)
The parser has parsed a nested-name-specifier 'identifier::'.
Ordinary name lookup, which finds ordinary names (functions, variables, typedefs, etc...
void setLookupName(DeclarationName Name)
Sets the name to look up.
bool LookupName(LookupResult &R, Scope *S, bool AllowBuiltinCreation=false)
Perform unqualified name lookup starting from a given scope.
void setLAngleLoc(SourceLocation Loc)
Microsoft's '__super' specifier, stored as a CXXRecordDecl* of the class it appeared in...
bool isEmpty() const
No scope specifier.
SemaDiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID)
Emit a diagnostic.
TagDecl * getDecl() const
NestedNameSpecifier * getPrefix() const
Return the prefix of this nested name specifier.
Defines the C++ template declaration subclasses.
bool RebuildNestedNameSpecifierInCurrentInstantiation(CXXScopeSpec &SS)
The base class of the type hierarchy.
void setTemplateKeywordLoc(SourceLocation Loc)
Represent a C++ namespace.
Wrapper for source info for typedefs.
Look up of a name that precedes the '::' scope resolution operator in C++.
bool isAcceptableNestedNameSpecifier(const NamedDecl *SD, bool *CanCorrect=nullptr)
Determines whether the given declaration is an valid acceptable result for name lookup of a nested-na...
bool hasVisibleDeclaration(const NamedDecl *D, llvm::SmallVectorImpl< Module *> *Modules=nullptr)
Determine whether any declaration of an entity is visible.
unsigned location_size() const
Retrieve the size of the data associated with source-location information.
bool IsInvalidUnlessNestedName(Scope *S, CXXScopeSpec &SS, NestedNameSpecInfo &IdInfo, bool EnteringContext)
IsInvalidUnlessNestedName - This method is used for error recovery purposes to determine whether the ...
LLVM_ATTRIBUTE_REINITIALIZES void clear()
Clears out any current state.
void * SaveNestedNameSpecifierAnnotation(CXXScopeSpec &SS)
Given a C++ nested-name-specifier, produce an annotation value that the parser can use later to recon...
const IdentifierInfo * getIdentifier() const
Returns the identifier to which this template name refers.
Look up a namespace name within a C++ using directive or namespace alias definition, ignoring non-namespace names (C++ [basic.lookup.udir]p1).
An identifier, stored as an IdentifierInfo*.
void Adopt(NestedNameSpecifierLoc Other)
Adopt an existing nested-name-specifier (with source-range information).
PartialDiagnostic PDiag(unsigned DiagID=0)
Build a partial diagnostic.
DeclarationName getLookupName() const
Gets the name to look up.
bool isEnumeralType() const
const T * getAs() const
Member-template getAs<specific type>'.
DeclContext * computeDeclContext(QualType T)
Compute the DeclContext that is associated with the given type.
NamedDecl * getUnderlyingDecl()
Looks through UsingDecls and ObjCCompatibleAliasDecls for the underlying named decl.
A namespace, stored as a NamespaceDecl*.
void setBegin(SourceLocation b)
void ActOnCXXExitDeclaratorScope(Scope *S, const CXXScopeSpec &SS)
ActOnCXXExitDeclaratorScope - Called when a declarator that previously invoked ActOnCXXEnterDeclarato...
SpecifierKind getKind() const
Determine what kind of nested name specifier is stored.
TemplateSpecializationKind getTemplateSpecializationKind() const
Determine what kind of template specialization this is.
Defines the clang::Expr interface and subclasses for C++ expressions.
bool isDependentScopeSpecifier(const CXXScopeSpec &SS)
bool ActOnCXXNestedNameSpecifierDecltype(CXXScopeSpec &SS, const DeclSpec &DS, SourceLocation ColonColonLoc)
A C++ nested-name-specifier augmented with source location information.
Represents a dependent template name that cannot be resolved prior to template instantiation.
SourceLocation getTypeSpecTypeLoc() const
NamespaceDecl * getNamespace()
Retrieve the namespace declaration aliased by this directive.
void setArgLocInfo(unsigned i, TemplateArgumentLocInfo AI)
TemplateDecl * getAsTemplateDecl() const
Retrieve the underlying template declaration that this template name refers to, if known...
Base class for callback objects used by Sema::CorrectTypo to check the validity of a potential typo c...
const Type * getAsType() const
Retrieve the type stored in this nested name specifier.
CXXRecordDecl * getCurrentInstantiationOf(NestedNameSpecifier *NNS)
If the given nested name specifier refers to the current instantiation, return the declaration that c...
bool ShouldEnterDeclaratorScope(Scope *S, const CXXScopeSpec &SS)
const DeclarationNameInfo & getLookupNameInfo() const
Gets the name info to look up.
static const TST TST_error
Wrapper for source info for unresolved typename using decls.
DeclClass * getAsSingle() const
CXXRecordDecl * getAsRecordDecl() const
Retrieve the record declaration stored in this nested name specifier.
IdentifierInfo * getAsIdentifier() const
Retrieve the identifier stored in this nested name specifier.
void setNameLoc(SourceLocation Loc)
Represents the results of name lookup.
void setRAngleLoc(SourceLocation Loc)
Wrapper for source info for injected class names of class templates.
A convenient class for passing around template argument information.
NamespaceAliasDecl * getAsNamespaceAlias() const
Retrieve the namespace alias stored in this nested name specifier.
Wrapper for substituted template type parameters.
Represents a declaration of a type.
Wrapper for substituted template type parameters.
bool isLambda() const
Determine whether this class describes a lambda function object.
Scope - A scope is a transient data structure that is used while parsing the program.
const Type * getTypePtr() const
Retrieves a pointer to the underlying (unqualified) type.
void SetInvalid(SourceRange R)
Indicate that this nested-name-specifier is invalid.
Represents a C++ nested-name-specifier or a global scope specifier.
const LangOptions & getLangOpts() const
void addDecl(NamedDecl *D)
Add a declaration to these results with its natural access.
NestedNameSpecifierLoc getWithLocInContext(ASTContext &Context) const
Retrieve a nested-name-specifier with location information, copied into the given AST context...
virtual Decl * getCanonicalDecl()
Retrieves the "canonical" declaration of the given declaration.
bool isNonTypeNestedNameSpecifier(Scope *S, CXXScopeSpec &SS, NestedNameSpecInfo &IdInfo)
TyLocType push(QualType T)
Pushes space for a new TypeLoc of the given type.
QualType CheckTemplateIdType(TemplateName Template, SourceLocation TemplateLoc, TemplateArgumentListInfo &TemplateArgs)
Sema - This implements semantic analysis and AST building for C.
void MarkAnyDeclReferenced(SourceLocation Loc, Decl *D, bool MightBeOdrUse)
Perform marking for a reference to an arbitrary declaration.
bool InstantiateEnum(SourceLocation PointOfInstantiation, EnumDecl *Instantiation, EnumDecl *Pattern, const MultiLevelTemplateArgumentList &TemplateArgs, TemplateSpecializationKind TSK)
Instantiate the definition of an enum from a given pattern.
SourceRange getRange() const
void setArgLocInfo(unsigned i, TemplateArgumentLocInfo AI)
TST getTypeSpecType() const
Scope * getCurScope() const
Retrieve the parser's current scope.
void setTemplateNameLoc(SourceLocation Loc)
SourceLocation IdentifierLoc
The location of the identifier.
void setQualifierLoc(NestedNameSpecifierLoc QualifierLoc)
NamespaceDecl * getAsNamespace() const
Retrieve the namespace stored in this nested name specifier.
MultiLevelTemplateArgumentList getTemplateInstantiationArgs(NamedDecl *D, const TemplateArgumentList *Innermost=nullptr, bool RelativeToPrimary=false, const FunctionDecl *Pattern=nullptr)
Retrieve the template argument list(s) that should be used to instantiate the definition of the given...
bool ActOnCXXGlobalScopeSpecifier(SourceLocation CCLoc, CXXScopeSpec &SS)
The parser has parsed a global nested-name-specifier '::'.
This file defines the classes used to store parsed information about declaration-specifiers and decla...
std::string getAsString() const
Retrieve the human-readable string for this name.
bool isFileContext() const
bool hasAnyDependentBases() const
Determine whether this class has any dependent base classes which are not the current instantiation...
void NoteAllFoundTemplates(TemplateName Name)
Represents a C++ template name within the type system.
bool RequireCompleteType(SourceLocation Loc, QualType T, TypeDiagnoser &Diagnoser)
Ensure that the type T is a complete type.
bool isIdentifier() const
Determine whether this template name refers to an identifier.
A namespace alias, stored as a NamespaceAliasDecl*.
bool isFunctionOrMethod() const
TagDecl * getAsTagDecl() const
Retrieves the TagDecl that this type refers to, either because the type is a TagType or because it is...
Wrapper for source info for enum types.
bool isSingleResult() const
Determines if this names a single result which is not an unresolved value using decl.
DeclContext * getParent()
getParent - Returns the containing DeclContext.
void diagnoseMissingImport(SourceLocation Loc, NamedDecl *Decl, MissingImportKind MIK, bool Recover=true)
Diagnose that the specified declaration needs to be visible but isn't, and suggest a module import th...
static bool hasDefinition(const ObjCObjectPointerType *ObjPtr)
IdentifierInfo * Identifier
The identifier preceding the '::'.
bool isDependentContext() const
Determines whether this context is dependent on a template parameter.
QualType getTypeDeclType(const TypeDecl *Decl, const TypeDecl *PrevDecl=nullptr) const
Return the unique reference to the type for the specified type declaration.
The result type of a method or function.
This template specialization was implicitly instantiated from a template.
bool isNull() const
Return true if this QualType doesn't point to a type yet.
A type, stored as a Type*.
bool resolveAssumedTemplateNameAsType(Scope *S, TemplateName &Name, SourceLocation NameLoc, bool Diagnose=true)
void translateTemplateArguments(const ASTTemplateArgsPtr &In, TemplateArgumentListInfo &Out)
Translates template arguments as provided by the parser into template arguments used by semantic anal...
EnumDecl * getInstantiatedFromMemberEnum() const
Returns the enumeration (declared within the template) from which this enumeration type was instantia...
NestedNameSpecifier * getScopeRep() const
Retrieve the representation of the nested-name-specifier.
char * location_data() const
Retrieve the data associated with the source-location information.
TypeLoc getTypeLocInContext(ASTContext &Context, QualType T)
Copies the type-location information to the given AST context and returns a TypeLoc referring into th...
OverloadedTemplateStorage * getAsOverloadedTemplate() const
Retrieve the underlying, overloaded function template declarations that this template name refers to...
void setLAngleLoc(SourceLocation Loc)
Encodes a location in the source.
void ExitDeclaratorContext(Scope *S)
Represents the declaration of a struct/union/class/enum.
Represents a static or instance method of a struct/union/class.
SourceLocation CCLoc
The location of the '::'.
bool hasVisibleDefinition(NamedDecl *D, NamedDecl **Suggested, bool OnlyNeedComplete=false)
Determine if D has a visible definition.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
TypoCorrection CorrectTypo(const DeclarationNameInfo &Typo, Sema::LookupNameKind LookupKind, Scope *S, CXXScopeSpec *SS, CorrectionCandidateCallback &CCC, CorrectTypoKind Mode, DeclContext *MemberContext=nullptr, bool EnteringContext=false, const ObjCObjectPointerType *OPT=nullptr, bool RecordFailure=true)
Try to "correct" a typo in the source code by finding visible declarations whose names are similar to...
void setElaboratedKeywordLoc(SourceLocation Loc)
bool DiagnoseUseOfDecl(NamedDecl *D, ArrayRef< SourceLocation > Locs, const ObjCInterfaceDecl *UnknownObjCClass=nullptr, bool ObjCPropertyAccess=false, bool AvoidPartialAvailabilityChecks=false, ObjCInterfaceDecl *ClassReciever=nullptr)
Determine whether the use of this declaration is valid, and emit any corresponding diagnostics...
__DEVICE__ void * memcpy(void *__a, const void *__b, size_t __c)
bool RequireCompleteDeclContext(CXXScopeSpec &SS, DeclContext *DC)
Require that the context specified by SS be complete.
bool isInvalid() const
An error occurred during parsing of the scope specifier.
DependentTemplateName * getAsDependentTemplateName() const
Retrieve the underlying dependent template name structure, if any.
void * Allocate(size_t Size, unsigned Align=8) const
void setTemplateKeywordLoc(SourceLocation Loc)
void diagnoseTypo(const TypoCorrection &Correction, const PartialDiagnostic &TypoDiag, bool ErrorRecovery=true)
Base class for declarations which introduce a typedef-name.
bool isCurrentInstantiation(const DeclContext *CurContext) const
Determine whether this dependent class is a current instantiation, when viewed from within the given ...
bool BuildCXXNestedNameSpecifier(Scope *S, NestedNameSpecInfo &IdInfo, bool EnteringContext, CXXScopeSpec &SS, NamedDecl *ScopeLookupResult, bool ErrorRecoveryLookup, bool *IsCorrectedToColon=nullptr, bool OnlyNamespace=false)
Build a new nested-name-specifier for "identifier::", as described by ActOnCXXNestedNameSpecifier.
Dataflow Directional Tag Classes.
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
The base class of all kinds of template declarations (e.g., class, function, etc.).
void setContextRange(SourceRange SR)
Sets a 'context' source range.
void EnterDeclaratorContext(Scope *S, DeclContext *DC)
EnterDeclaratorContext - Used when we must lookup names in the context of a declarator's nested name ...
static const TST TST_decltype
bool isDependent() const
Whether this nested name specifier refers to a dependent type or not.
NamedDecl * getCorrectionDecl() const
Gets the pointer to the declaration of the typo correction.
The name of a declaration.
Optional< sema::TemplateDeductionInfo * > isSFINAEContext() const
Determines whether we are currently in a context where template argument substitution failures are no...
A type that was preceded by the 'template' keyword, stored as a Type*.
bool ActOnSuperScopeSpecifier(SourceLocation SuperLoc, SourceLocation ColonColonLoc, CXXScopeSpec &SS)
The parser has parsed a '__super' nested-name-specifier.
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
QualType getCanonicalTypeInternal() const
This template specialization was declared or defined by an explicit specialization (C++ [temp...
void RestoreNestedNameSpecifierAnnotation(void *Annotation, SourceRange AnnotationRange, CXXScopeSpec &SS)
Given an annotation pointer for a nested-name-specifier, restore the nested-name-specifier structure...
QualType BuildDecltypeType(Expr *E, SourceLocation Loc, bool AsUnevaluated=true)
If AsUnevaluated is false, E is treated as though it were an evaluated context, such as when building...
DeclContext * getRedeclContext()
getRedeclContext - Retrieve the context in which an entity conflicts with other entities of the same ...
bool hasSameType(QualType T1, QualType T2) const
Determine whether the given types T1 and T2 are equivalent.
Wrapper for source info for record types.
AssumedTemplateStorage * getAsAssumedTemplateName() const
Retrieve information on a name that has been assumed to be a template-name in order to permit a call ...
Implements a partial diagnostic that can be emitted anwyhere in a DiagnosticBuilder stream...
Sema::LookupNameKind getLookupKind() const
Gets the kind of lookup to perform.
static QualType GetTypeFromParser(ParsedType Ty, TypeSourceInfo **TInfo=nullptr)
ParsedType ObjectType
The type of the object, if we're parsing nested-name-specifier in a member access expression...
bool LookupQualifiedName(LookupResult &R, DeclContext *LookupCtx, bool InUnqualifiedLookup=false)
Perform qualified name lookup into a given context.
bool ActOnCXXEnterDeclaratorScope(Scope *S, CXXScopeSpec &SS)
ActOnCXXEnterDeclaratorScope - Called when a C++ scope specifier (global scope or nested-name-specifi...
CanQualType getCanonicalType(QualType T) const
Return the canonical (structural) type corresponding to the specified potentially non-canonical type ...
bool isSet() const
Deprecated.
void Extend(ASTContext &Context, SourceLocation TemplateKWLoc, TypeLoc TL, SourceLocation ColonColonLoc)
Extend the current nested-name-specifier by another nested-name-specifier component of the form 'type...
TranslationUnitDecl * getTranslationUnitDecl() const
Captures information about "declaration specifiers".
Represents a C++ struct/union/class.
Provides information a specialization of a member of a class template, which may be a member function...
DeclContext * CurContext
CurContext - This is the current declaration context of parsing.
Declaration of a class template.
static FixItHint CreateReplacement(CharSourceRange RemoveRange, StringRef Code)
Create a code modification hint that replaces the given source range with the given code string...
void MakeGlobal(ASTContext &Context, SourceLocation ColonColonLoc)
Turn this (empty) nested-name-specifier into the global nested-name-specifier '::'.
void setRAngleLoc(SourceLocation Loc)
StringRef getName() const
Get the name of identifier for this declaration as a StringRef.
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
static CXXRecordDecl * getCurrentInstantiationOf(QualType T, DeclContext *CurContext)
Find the current instantiation that associated with the given type.
Represents a type template specialization; the template must be a class template, a type alias templa...
QualType getDependentTemplateSpecializationType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, const IdentifierInfo *Name, const TemplateArgumentListInfo &Args) const
void suppressDiagnostics()
Suppress the diagnostics that would normally fire because of this lookup.
bool empty() const
Return true if no decls were found.
Wrapper for template type parameters.
A trivial tuple used to represent a source range.
This represents a decl that may have a name.
Expr * getRepAsExpr() const
Represents a C++ namespace alias.
void setTemplateNameLoc(SourceLocation Loc)
No keyword precedes the qualified type name.
SourceLocation getNameLoc() const
Gets the location of the identifier.
NamedDecl * getRepresentativeDecl() const
Fetches a representative decl. Useful for lazy diagnostics.
The global specifier '::'. There is no stored value.
SourceLocation getBegin() const
const LangOptions & getLangOpts() const
SourceLocation getLocation() const
bool isEditorPlaceholder() const
Return true if this identifier is an editor placeholder.
bool isBeingDefined() const
Return true if this decl is currently being defined.