24 #include "llvm/ADT/STLExtras.h" 25 using namespace clang;
34 if (
const RecordType *RecordTy = dyn_cast<RecordType>(Ty)) {
35 CXXRecordDecl *Record = cast<CXXRecordDecl>(RecordTy->getDecl());
41 }
else if (isa<InjectedClassNameType>(Ty))
42 return cast<InjectedClassNameType>(Ty)->getDecl();
57 return Tag->getDecl();
76 bool EnteringContext) {
87 if (EnteringContext) {
101 = dyn_cast_or_null<ClassTemplateDecl>(
102 SpecType->getTemplateName().getAsTemplateDecl())) {
110 = ClassTemplate->getInjectedClassNameSpecialization();
112 return ClassTemplate->getTemplatedDecl();
119 = ClassTemplate->findPartialSpecialization(ContextType)) {
124 "partial specialization scope specifier in SFINAE context?");
134 return RecordT->getDecl();
143 llvm_unreachable(
"Dependent nested-name-specifier has no DeclContext");
154 assert(Tag &&
"Non-tag type in nested-name-specifier");
165 llvm_unreachable(
"Invalid NestedNameSpecifier::Kind!");
182 assert(NNS->
isDependent() &&
"Only dependent nested-name-specifier allowed");
202 assert(DC &&
"given null context");
245 return !TreatAsComplete;
265 Diag(loc, diag::err_incomplete_nested_name_spec)
282 if (S->isFunctionScope()) {
283 if (
CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(S->getEntity()))
287 if (S->isClassScope()) {
288 RD = cast<CXXRecordDecl>(S->getEntity());
294 Diag(SuperLoc, diag::err_invalid_super_scope);
297 Diag(SuperLoc, diag::err_super_in_lambda_unsupported);
300 Diag(SuperLoc, diag::err_no_base_classes) << RD->
getName();
321 if (isa<NamespaceDecl>(SD))
324 if (!isa<TypeDecl>(SD))
333 if (TD->getUnderlyingType()->isRecordType())
335 if (TD->getUnderlyingType()->isEnumeralType()) {
341 }
else if (isa<RecordDecl>(SD)) {
343 }
else if (isa<EnumDecl>(SD)) {
370 assert(!Found.isAmbiguous() &&
"Cannot handle ambiguities here yet");
372 if (!Found.isSingleResult())
390 bool isDependent =
false;
391 if (!ObjectType.
isNull()) {
394 assert(!SS.
isSet() &&
"ObjectType and scope specifier cannot coexist");
397 }
else if (SS.
isSet()) {
417 }
else if (isDependent) {
433 explicit NestedNameSpecifierValidatorCCC(
Sema &SRef)
436 bool ValidateCandidate(
const TypoCorrection &candidate)
override {
480 bool ErrorRecoveryLookup,
481 bool *IsCorrectedToColon,
482 bool OnlyNamespace) {
492 bool isDependent =
false;
493 if (IsCorrectedToColon)
494 *IsCorrectedToColon =
false;
495 if (!ObjectType.
isNull()) {
498 assert(!SS.
isSet() &&
"ObjectType and scope specifier cannot coexist");
501 }
else if (SS.
isSet()) {
509 bool ObjectTypeSearchedInScope =
false;
546 else if (ScopeLookupResult)
547 Found.
addDecl(ScopeLookupResult);
549 ObjectTypeSearchedInScope =
true;
551 }
else if (!isDependent) {
561 if (Found.
empty() && isDependent &&
562 !(LookupCtx && LookupCtx->
isRecord() &&
564 !cast<CXXRecordDecl>(LookupCtx)->hasAnyDependentBases()))) {
566 if (ErrorRecoveryLookup)
577 if (Found.
empty() && !ErrorRecoveryLookup) {
583 else if (S && !isDependent)
587 R.suppressDiagnostics();
590 if (IsCorrectedToColon) {
591 *IsCorrectedToColon =
true;
592 Diag(IdInfo.
CCLoc, diag::err_nested_name_spec_is_not_class)
596 Diag(ND->getLocation(), diag::note_declared_at);
600 Diag(R.getNameLoc(), OnlyNamespace
601 ? unsigned(diag::err_expected_namespace_name)
602 : unsigned(diag::err_expected_class_or_namespace))
605 Diag(ND->getLocation(), diag::note_entity_declared_at)
618 llvm::make_unique<NestedNameSpecifierValidatorCCC>(*this),
621 bool DroppedSpecifier =
622 Corrected.WillReplaceSpecifier() &&
624 if (DroppedSpecifier)
627 << Name << LookupCtx << DroppedSpecifier
633 if (Corrected.getCorrectionSpecifier())
634 SS.MakeTrivial(
Context, Corrected.getCorrectionSpecifier(),
637 if (
NamedDecl *ND = Corrected.getFoundDecl())
647 bool IsExtension =
false;
649 if (!AcceptSpec && IsExtension) {
654 if (!ObjectType.
isNull() && !ObjectTypeSearchedInScope &&
669 LookupNestedNameSpecifierName);
673 OuterDecl = ScopeLookupResult;
677 (!isa<TypeDecl>(OuterDecl) || !isa<TypeDecl>(SD) ||
681 if (ErrorRecoveryLookup)
685 diag::err_nested_name_member_ref_lookup_ambiguous)
696 if (
auto *TD = dyn_cast_or_null<TypedefNameDecl>(SD))
701 if (ErrorRecoveryLookup)
707 if (
NamespaceDecl *Namespace = dyn_cast<NamespaceDecl>(SD)) {
720 if (isa<InjectedClassNameType>(T)) {
724 }
else if (isa<RecordType>(T)) {
727 }
else if (isa<TypedefType>(T)) {
730 }
else if (isa<EnumType>(T)) {
733 }
else if (isa<TemplateTypeParmType>(T)) {
737 }
else if (isa<UnresolvedUsingType>(T)) {
741 }
else if (isa<SubstTemplateTypeParmType>(T)) {
745 }
else if (isa<SubstTemplateTypeParmPackType>(T)) {
750 llvm_unreachable(
"Unhandled TypeDecl node in nested-name-specifier");
763 if (ErrorRecoveryLookup)
797 diag::ext_undeclared_unqual_id_with_dependent_base)
806 if (!Found.
empty()) {
814 Diag(ND->getLocation(), diag::note_entity_declared_at)
817 }
else if (SS.
isSet())
829 bool ErrorRecoveryLookup,
830 bool *IsCorrectedToColon,
831 bool OnlyNamespace) {
837 IsCorrectedToColon, OnlyNamespace);
852 if (!T->isDependentType() && !T->getAs<
TagType>()) {
874 bool EnteringContext) {
891 bool EnteringContext) {
919 for (
unsigned I = 0, N = TemplateArgs.
size(); I != N; ++I)
929 isa<FunctionTemplateDecl>(TD) || isa<VarTemplateDecl>(TD)) {
934 Diag(CCLoc, diag::err_non_type_template_in_nested_name_specifier)
935 << (TD && isa<VarTemplateDecl>(TD)) << Template.
get() << R;
950 Diag(TemplateNameLoc, diag::err_nested_name_spec_non_tag) << T;
963 for (
unsigned I = 0, N = TemplateArgs.
size(); I != N; ++I)
975 struct NestedNameSpecifierAnnotation {
985 (
sizeof(NestedNameSpecifierAnnotation) + SS.
location_size()),
986 alignof(NestedNameSpecifierAnnotation));
987 NestedNameSpecifierAnnotation *Annotation
988 =
new (Mem) NestedNameSpecifierAnnotation;
997 if (!AnnotationPtr) {
1002 NestedNameSpecifierAnnotation *Annotation
1003 =
static_cast<NestedNameSpecifierAnnotation *
>(AnnotationPtr);
1008 assert(SS.
isSet() &&
"Parser passed invalid CXXScopeSpec.");
1031 switch (Qualifier->
getKind()) {
1047 llvm_unreachable(
"Invalid NestedNameSpecifier::Kind!");
1057 assert(SS.
isSet() &&
"Parser passed invalid CXXScopeSpec.");
1062 if (!DC)
return true;
1084 assert(SS.
isSet() &&
"Parser passed invalid CXXScopeSpec.");
1088 "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...
const AstTypeMatcher< TagType > tagType
Matches tag types (record and enum types).
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 ...
void * SaveNestedNameSpecifierAnnotation(CXXScopeSpec &SS)
Given a C++ nested-name-specifier, produce an annotation value that the parser can use later to recon...
bool isCompleteDefinition() const
Return true if this decl has its body fully specified.
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.
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this enumeration is an instantiation of a member enumeration of a class template specialization...
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 DiagnoseUseOfDecl(NamedDecl *D, ArrayRef< SourceLocation > Locs, const ObjCInterfaceDecl *UnknownObjCClass=nullptr, bool ObjCPropertyAccess=false, bool AvoidPartialAvailabilityChecks=false)
Determine whether the use of this declaration is valid, and emit any corresponding diagnostics...
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
getNameAsString - 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)
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
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*.
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.
void setLAngleLoc(SourceLocation Loc)
Encodes a location in the source.
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of enums...
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>::".
void setElaboratedKeywordLoc(SourceLocation Loc)
EnumDecl * getDecl() const
__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.
DeclarationName - 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.
Implements a partial diagnostic that can be emitted anwyhere in a DiagnosticBuilder stream...
Sema::LookupNameKind getLookupKind() const
Gets the kind of lookup to perform.
bool isBeingDefined() const
Determines whether this type is in the process of being defined.
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.
TypoCorrection CorrectTypo(const DeclarationNameInfo &Typo, Sema::LookupNameKind LookupKind, Scope *S, CXXScopeSpec *SS, std::unique_ptr< 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...
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
void clear()
Clears out any current state.
SourceLocation getLocation() const
const AstTypeMatcher< EnumType > enumType
Matches enum types.
bool isEditorPlaceholder() const
Return true if this identifier is an editor placeholder.