24 #include "llvm/ADT/STLExtras.h"
25 #include "llvm/Support/raw_ostream.h"
26 using namespace clang;
35 if (
const RecordType *RecordTy = dyn_cast<RecordType>(Ty)) {
36 CXXRecordDecl *Record = cast<CXXRecordDecl>(RecordTy->getDecl());
42 }
else if (isa<InjectedClassNameType>(Ty))
43 return cast<InjectedClassNameType>(Ty)->getDecl();
58 return Tag->getDecl();
77 bool EnteringContext) {
88 if (EnteringContext) {
102 = dyn_cast_or_null<ClassTemplateDecl>(
103 SpecType->getTemplateName().getAsTemplateDecl())) {
111 = ClassTemplate->getInjectedClassNameSpecialization();
113 return ClassTemplate->getTemplatedDecl();
120 = ClassTemplate->findPartialSpecialization(ContextType))
125 return RecordT->getDecl();
134 llvm_unreachable(
"Dependent nested-name-specifier has no DeclContext");
145 assert(Tag &&
"Non-tag type in nested-name-specifier");
156 llvm_unreachable(
"Invalid NestedNameSpecifier::Kind!");
173 assert(NNS->
isDependent() &&
"Only dependent nested-name-specifier allowed");
193 assert(DC &&
"given null context");
222 const EnumType *enumType = dyn_cast_or_null<EnumType>(tagType);
241 Diag(loc, diag::err_incomplete_nested_name_spec)
258 if (
S->isFunctionScope()) {
263 if (
S->isClassScope()) {
264 RD = cast<CXXRecordDecl>(
S->getEntity());
270 Diag(SuperLoc, diag::err_invalid_super_scope);
273 Diag(SuperLoc, diag::err_super_in_lambda_unsupported);
276 Diag(SuperLoc, diag::err_no_base_classes) << RD->
getName();
297 if (isa<NamespaceDecl>(SD))
300 if (!isa<TypeDecl>(SD))
309 if (TD->getUnderlyingType()->isRecordType())
311 if (TD->getUnderlyingType()->isEnumeralType()) {
317 }
else if (isa<RecordDecl>(SD)) {
319 }
else if (isa<EnumDecl>(SD)) {
346 assert(!Found.isAmbiguous() &&
"Cannot handle ambiguities here yet");
348 if (!Found.isSingleResult())
367 bool isDependent =
false;
368 if (!ObjectType.
isNull()) {
371 assert(!SS.
isSet() &&
"ObjectType and scope specifier cannot coexist");
374 }
else if (SS.
isSet()) {
394 }
else if (isDependent) {
410 explicit NestedNameSpecifierValidatorCCC(
Sema &SRef)
413 bool ValidateCandidate(
const TypoCorrection &candidate)
override {
461 bool EnteringContext,
464 bool ErrorRecoveryLookup,
465 bool *IsCorrectedToColon) {
471 bool isDependent =
false;
472 if (IsCorrectedToColon)
473 *IsCorrectedToColon =
false;
474 if (!ObjectType.
isNull()) {
477 assert(!SS.
isSet() &&
"ObjectType and scope specifier cannot coexist");
480 }
else if (SS.
isSet()) {
488 bool ObjectTypeSearchedInScope =
false;
525 else if (ScopeLookupResult)
526 Found.
addDecl(ScopeLookupResult);
528 ObjectTypeSearchedInScope =
true;
530 }
else if (!isDependent) {
540 if (Found.
empty() && isDependent &&
541 !(LookupCtx && LookupCtx->
isRecord() &&
543 !cast<CXXRecordDecl>(LookupCtx)->hasAnyDependentBases()))) {
545 if (ErrorRecoveryLookup)
556 if (Found.
empty() && !ErrorRecoveryLookup) {
562 else if (S && !isDependent)
566 R.suppressDiagnostics();
569 if (IsCorrectedToColon) {
570 *IsCorrectedToColon =
true;
571 Diag(CCLoc, diag::err_nested_name_spec_is_not_class)
575 Diag(ND->getLocation(), diag::note_declared_at);
579 Diag(R.getNameLoc(), diag::err_expected_class_or_namespace)
582 Diag(ND->getLocation(), diag::note_entity_declared_at) << &Identifier;
594 llvm::make_unique<NestedNameSpecifierValidatorCCC>(*this),
597 bool DroppedSpecifier =
598 Corrected.WillReplaceSpecifier() &&
600 if (DroppedSpecifier)
603 << Name << LookupCtx << DroppedSpecifier
609 if (
NamedDecl *ND = Corrected.getFoundDecl())
619 bool IsExtension =
false;
621 if (!AcceptSpec && IsExtension) {
623 Diag(IdentifierLoc, diag::ext_nested_name_spec_is_enum);
626 if (!ObjectType.
isNull() && !ObjectTypeSearchedInScope &&
640 LookupResult FoundOuter(*
this, &Identifier, IdentifierLoc,
645 OuterDecl = ScopeLookupResult;
649 (!isa<TypeDecl>(OuterDecl) || !isa<TypeDecl>(SD) ||
653 if (ErrorRecoveryLookup)
657 diag::err_nested_name_member_ref_lookup_ambiguous)
668 if (
auto *TD = dyn_cast_or_null<TypedefNameDecl>(SD))
673 if (ErrorRecoveryLookup)
680 if (
NamespaceDecl *Namespace = dyn_cast<NamespaceDecl>(SD)) {
693 if (isa<InjectedClassNameType>(T)) {
697 }
else if (isa<RecordType>(T)) {
700 }
else if (isa<TypedefType>(T)) {
703 }
else if (isa<EnumType>(T)) {
706 }
else if (isa<TemplateTypeParmType>(T)) {
710 }
else if (isa<UnresolvedUsingType>(T)) {
714 }
else if (isa<SubstTemplateTypeParmType>(T)) {
718 }
else if (isa<SubstTemplateTypeParmPackType>(T)) {
723 llvm_unreachable(
"Unhandled TypeDecl node in nested-name-specifier");
727 Diag(IdentifierLoc, diag::warn_cxx98_compat_enum_nested_name_spec);
736 if (ErrorRecoveryLookup)
769 Diag(IdentifierLoc, diag::ext_undeclared_unqual_id_with_dependent_base)
770 << &Identifier << ContainingClass;
777 if (!Found.
empty()) {
779 Diag(IdentifierLoc, diag::err_expected_class_or_namespace)
782 Diag(IdentifierLoc, diag::err_expected_class_or_namespace)
785 Diag(ND->getLocation(), diag::note_entity_declared_at) << &Identifier;
787 }
else if (SS.
isSet())
788 Diag(IdentifierLoc, diag::err_no_member) << &Identifier << LookupCtx
791 Diag(IdentifierLoc, diag::err_undeclared_var_use) << &Identifier;
801 bool EnteringContext,
803 bool ErrorRecoveryLookup,
804 bool *IsCorrectedToColon) {
824 if (!T->isDependentType() && !T->getAs<
TagType>()) {
849 bool EnteringContext) {
868 bool EnteringContext) {
896 for (
unsigned I = 0, N = TemplateArgs.
size();
I != N; ++
I)
906 isa<FunctionTemplateDecl>(TD) || isa<VarTemplateDecl>(TD)) {
911 Diag(CCLoc, diag::err_non_type_template_in_nested_name_specifier)
912 << (TD && isa<VarTemplateDecl>(TD)) << Template.
get() << R;
927 Diag(TemplateNameLoc, diag::err_nested_name_spec_non_tag) << T;
940 for (
unsigned I = 0, N = TemplateArgs.
size();
I != N; ++
I)
952 struct NestedNameSpecifierAnnotation {
963 llvm::alignOf<NestedNameSpecifierAnnotation>());
964 NestedNameSpecifierAnnotation *Annotation
965 =
new (Mem) NestedNameSpecifierAnnotation;
974 if (!AnnotationPtr) {
979 NestedNameSpecifierAnnotation *Annotation
980 =
static_cast<NestedNameSpecifierAnnotation *
>(AnnotationPtr);
985 assert(SS.
isSet() &&
"Parser passed invalid CXXScopeSpec.");
1003 switch (Qualifier->getKind()) {
1019 llvm_unreachable(
"Invalid NestedNameSpecifier::Kind!");
1029 assert(SS.
isSet() &&
"Parser passed invalid CXXScopeSpec.");
1034 if (!DC)
return true;
1056 assert(SS.
isSet() &&
"Parser passed invalid CXXScopeSpec.");
1060 "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.
Scope * getCurScope() const
Retrieve the parser's current scope.
StringRef getName() const
getName - Get the name of identifier for this declaration as a StringRef.
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.
Simple class containing the result of Sema::CorrectTypo.
Ordinary name lookup, which finds ordinary names (functions, variables, typedefs, etc...
const LangOptions & getLangOpts() const
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.
DeclClass * getAsSingle() const
NamedDecl * getRepresentativeDecl() const
Fetches a representative decl. Useful for lazy diagnostics.
void setLAngleLoc(SourceLocation Loc)
TemplateDecl * getAsTemplateDecl() const
Retrieve the underlying template declaration that this template name refers to, if known...
Microsoft's '__super' specifier, stored as a CXXRecordDecl* of the class it appeared in...
SemaDiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID)
Emit a diagnostic.
Defines the C++ template declaration subclasses.
bool RebuildNestedNameSpecifierInCurrentInstantiation(CXXScopeSpec &SS)
bool isEnumeralType() const
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this enumeration is an instantiation of a member enumeration of a class template specialization...
TemplateSpecializationType(TemplateName T, const TemplateArgument *Args, unsigned NumArgs, QualType Canon, QualType Aliased)
The base class of the type hierarchy.
CXXRecordDecl * getAsRecordDecl() const
Retrieve the record declaration stored in this nested name specifier.
bool isDependentContext() const
Determines whether this context is dependent on a template parameter.
void setTemplateKeywordLoc(SourceLocation Loc)
NamespaceDecl - Represent a C++ namespace.
NestedNameSpecifier * getPrefix() const
Return the prefix of this nested name specifier.
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...
void * SaveNestedNameSpecifierAnnotation(CXXScopeSpec &SS)
Given a C++ nested-name-specifier, produce an annotation value that the parser can use later to recon...
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.
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...
Defines the clang::Expr interface and subclasses for C++ expressions.
bool isEmpty() const
No scope specifier.
const IdentifierInfo * getIdentifier() const
Returns the identifier to which this template name refers.
void MarkAnyDeclReferenced(SourceLocation Loc, Decl *D, bool OdrUse)
Perform marking for a reference to an arbitrary declaration.
bool isDependentScopeSpecifier(const CXXScopeSpec &SS)
bool ActOnCXXNestedNameSpecifierDecltype(CXXScopeSpec &SS, const DeclSpec &DS, SourceLocation ColonColonLoc)
One of these records is kept for each identifier that is lexed.
OverloadedTemplateStorage * getAsOverloadedTemplate() const
Retrieve the underlying, overloaded function template.
EnumDecl * getInstantiatedFromMemberEnum() const
Returns the enumeration (declared within the template) from which this enumeration type was instantia...
class LLVM_ALIGNAS(8) DependentTemplateSpecializationType const IdentifierInfo * Name
Represents a template specialization type whose template cannot be resolved, e.g. ...
A C++ nested-name-specifier augmented with source location information.
Represents a dependent template name that cannot be resolved prior to template instantiation.
bool isIdentifier() const
Determine whether this template name refers to an identifier.
NamespaceDecl * getNamespace()
Retrieve the namespace declaration aliased by this directive.
void setArgLocInfo(unsigned i, TemplateArgumentLocInfo AI)
Base class for callback objects used by Sema::CorrectTypo to check the validity of a potential typo c...
bool isCompleteDefinition() const
isCompleteDefinition - Return true if this decl has its body fully specified.
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)
bool isBeingDefined() const
Determines whether this type is in the process of being defined.
bool hasSameType(QualType T1, QualType T2) const
Determine whether the given types T1 and T2 are equivalent.
static const TST TST_error
Wrapper for source info for unresolved typename using decls.
SourceLocation getTypeSpecTypeLoc() const
QualType getTypeDeclType(const TypeDecl *Decl, const TypeDecl *PrevDecl=nullptr) const
Return the unique reference to the type for the specified type declaration.
void setNameLoc(SourceLocation Loc)
Represents the results of name lookup.
bool DiagnoseUseOfDecl(NamedDecl *D, SourceLocation Loc, const ObjCInterfaceDecl *UnknownObjCClass=nullptr, bool ObjCPropertyAccess=false)
Determine whether the use of this declaration is valid, and emit any corresponding diagnostics...
void setRAngleLoc(SourceLocation Loc)
const LangOptions & getLangOpts() const
Wrapper for source info for injected class names of class templates.
A convenient class for passing around template argument information.
unsigned location_size() const
Retrieve the size of the data associated with source-location information.
Wrapper for substituted template type parameters.
char * location_data() const
Retrieve the data associated with the source-location information.
TypeDecl - Represents a declaration of a type.
Wrapper for substituted template type parameters.
Scope - A scope is a transient data structure that is used while parsing the program.
void SetInvalid(SourceRange R)
Indicate that this nested-name-specifier is invalid.
bool isDependent() const
Whether this nested name specifier refers to a dependent type or not.
Represents a C++ nested-name-specifier or a global scope specifier.
NestedNameSpecifier * getQualifier() const
Return the nested name specifier that qualifies this name.
std::string getAsString() const
getNameAsString - Retrieve the human-readable string for this name.
void addDecl(NamedDecl *D)
Add a declaration to these results with its natural access.
detail::InMemoryDirectory::const_iterator I
QualType getCanonicalTypeInternal() const
virtual Decl * getCanonicalDecl()
Retrieves the "canonical" declaration of the given declaration.
SourceRange getRange() const
TyLocType push(QualType T)
Pushes space for a new TypeLoc of the given type.
EnumDecl * getDecl() const
QualType CheckTemplateIdType(TemplateName Template, SourceLocation TemplateLoc, TemplateArgumentListInfo &TemplateArgs)
Sema - This implements semantic analysis and AST building for C.
TST getTypeSpecType() const
const DeclarationNameInfo & getLookupNameInfo() const
Gets the name info to look up.
bool InstantiateEnum(SourceLocation PointOfInstantiation, EnumDecl *Instantiation, EnumDecl *Pattern, const MultiLevelTemplateArgumentList &TemplateArgs, TemplateSpecializationKind TSK)
Instantiate the definition of an enum from a given pattern.
void setArgLocInfo(unsigned i, TemplateArgumentLocInfo AI)
void setTemplateNameLoc(SourceLocation Loc)
QualType getDependentTemplateSpecializationType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier *NNS, const IdentifierInfo *Name, const TemplateArgumentListInfo &Args) const
SpecifierKind getKind() const
Determine what kind of nested name specifier is stored.
void setQualifierLoc(NestedNameSpecifierLoc QualifierLoc)
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...
DeclarationName getLookupName() const
Gets the name to look up.
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...
TranslationUnitDecl * getTranslationUnitDecl() const
void NoteAllFoundTemplates(TemplateName Name)
bool RequireCompleteType(SourceLocation Loc, QualType T, TypeDiagnoser &Diagnoser)
Ensure that the type T is a complete type.
A namespace alias, stored as a NamespaceAliasDecl*.
Wrapper for source info for enum types.
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
bool isFunctionOrMethod() const
DeclContext * getParent()
getParent - Returns the containing DeclContext.
static bool hasDefinition(const ObjCObjectPointerType *ObjPtr)
unsigned getNumBases() const
Retrieves the number of base classes of this class.
Wraps an identifier and optional source location for the identifier.
const Type * getAsType() const
Retrieve the type stored in this nested name specifier.
The result type of a method or function.
This template specialization was implicitly instantiated from a template.
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...
NestedNameSpecifier * getScopeRep() const
Retrieve the representation of the nested-name-specifier.
NamespaceDecl * getAsNamespace() const
Retrieve the namespace stored in this nested name specifier.
TypeLoc getTypeLocInContext(ASTContext &Context, QualType T)
Copies the type-location information to the given AST context and returns a TypeLoc referring into th...
SourceLocation getLastQualifierNameLoc() const
Retrieve the location of the name in the last qualifier in this nested name specifier.
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...
const Type * getTypePtr() const
Retrieves a pointer to the underlying (unqualified) type.
Expr * getRepAsExpr() const
void ExitDeclaratorContext(Scope *S)
TagDecl - Represents the declaration of a struct/union/class/enum.
NestedNameSpecifierLoc getWithLocInContext(ASTContext &Context) const
Retrieve a nested-name-specifier with location information, copied into the given AST context...
Represents a static or instance method of a struct/union/class.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
bool isInvalid() const
An error occurred during parsing of the scope specifier.
void setElaboratedKeywordLoc(SourceLocation Loc)
NamespaceAliasDecl * getAsNamespaceAlias() const
Retrieve the namespace alias stored in this nested name specifier.
SourceLocation getBegin() const
bool isFileContext() const
bool RequireCompleteDeclContext(CXXScopeSpec &SS, DeclContext *DC)
Require that the context specified by SS be complete.
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 ActOnCXXNestedNameSpecifier(Scope *S, IdentifierInfo &Identifier, SourceLocation IdentifierLoc, SourceLocation CCLoc, ParsedType ObjectType, bool EnteringContext, CXXScopeSpec &SS, bool ErrorRecoveryLookup=false, bool *IsCorrectedToColon=nullptr)
The parser has parsed a nested-name-specifier 'identifier::'.
bool IsInvalidUnlessNestedName(Scope *S, CXXScopeSpec &SS, IdentifierInfo &Identifier, SourceLocation IdentifierLoc, SourceLocation ColonLoc, ParsedType ObjectType, bool EnteringContext)
IsInvalidUnlessNestedName - This method is used for error recovery purposes to determine whether the ...
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 ...
Sema::LookupNameKind getLookupKind() const
Gets the kind of lookup to perform.
static const TST TST_decltype
const internal::VariadicAllOfMatcher< Type > type
Matches Types in the clang AST.
bool BuildCXXNestedNameSpecifier(Scope *S, IdentifierInfo &Identifier, SourceLocation IdentifierLoc, SourceLocation CCLoc, QualType ObjectType, bool EnteringContext, CXXScopeSpec &SS, NamedDecl *ScopeLookupResult, bool ErrorRecoveryLookup, bool *IsCorrectedToColon=nullptr)
Build a new nested-name-specifier for "identifier::", as described by ActOnCXXNestedNameSpecifier.
IdentifierInfo * getAsIdentifier() const
Retrieve the identifier stored in this nested name specifier.
TemplateSpecializationKind getTemplateSpecializationKind() const
Determine what kind of template specialization this is.
DeclarationName - The name of a declaration.
EnumDecl - Represents an enum.
bool isSingleResult() const
Determines if this names a single result which is not an unresolved value using decl.
CanQualType getCanonicalType(QualType T) const
Return the canonical (structural) type corresponding to the specified potentially non-canonical type ...
bool isCurrentInstantiation(const DeclContext *CurContext) const
Determine whether this dependent class is a current instantiation, when viewed from within the given ...
bool hasAnyDependentBases() const
Determine whether this class has any dependent base classes which are not the current instantiation...
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.
bool isLambda() const
Determine whether this class describes a lambda function object.
bool empty() const
Return true if no decls were found.
NamedDecl * getCorrectionDecl() const
Gets the pointer to the declaration of the typo correction.
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
const T * getAs() const
Member-template getAs<specific type>'.
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 ...
Wrapper for source info for record types.
Implements a partial diagnostic that can be emitted anwyhere in a DiagnosticBuilder stream...
static QualType GetTypeFromParser(ParsedType Ty, TypeSourceInfo **TInfo=nullptr)
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...
DependentTemplateName * getAsDependentTemplateName() const
Retrieve the underlying dependent template name structure, if any.
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...
Captures information about "declaration specifiers".
bool isNonTypeNestedNameSpecifier(Scope *S, CXXScopeSpec &SS, SourceLocation IdLoc, IdentifierInfo &II, ParsedType ObjectType)
Represents a C++ struct/union/class.
BoundNodesTreeBuilder *const Builder
void * Allocate(size_t Size, unsigned Align=8) const
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)
TagDecl * getDecl() const
static CXXRecordDecl * getCurrentInstantiationOf(QualType T, DeclContext *CurContext)
Find the current instantiation that associated with the given type.
bool isSet() const
Deprecated.
void suppressDiagnostics()
Suppress the diagnostics that would normally fire because of this lookup.
Wrapper for template type parameters.
A trivial tuple used to represent a source range.
SourceLocation getLocation() const
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...
NamedDecl - This represents a decl with a name.
Represents a C++ namespace alias.
void setTemplateNameLoc(SourceLocation Loc)
No keyword precedes the qualified type name.
bool isNull() const
Return true if this QualType doesn't point to a type yet.
The global specifier '::'. There is no stored value.
SourceLocation ColonLoc
Location of ':'.
void clear()
Clears out any current state.