22#include "llvm/ADT/STLExtras.h"
32 if (!isa_and_present<RecordType, InjectedClassNameType>(TagTy))
36 if (isa<InjectedClassNameType>(TagTy) ||
37 RD->isCurrentInstantiation(CurContext))
50 bool EnteringContext) {
61 if (EnteringContext) {
68 if (
const auto *SpecType =
69 dyn_cast<TemplateSpecializationType>(NNSType)) {
74 dyn_cast_or_null<ClassTemplateDecl>(
75 SpecType->getTemplateName().getAsTemplateDecl())) {
84 if (!TemplateParamLists.empty()) {
85 unsigned Depth =
ClassTemplate->getTemplateParameters()->getDepth();
86 auto L = find_if(TemplateParamLists,
90 if (L != TemplateParamLists.end()) {
93 SpecType->template_arguments(), *L, Pos);
105 "specifier in SFINAE context?");
122 }
else if (
const auto *RecordT = dyn_cast<RecordType>(NNSType)) {
124 return RecordT->getOriginalDecl()->getDefinitionOrSelf();
146 llvm_unreachable(
"unexpected null nested name specifier");
149 llvm_unreachable(
"Invalid NestedNameSpecifier::Kind!");
161 assert(NNS.
isDependent() &&
"Only dependent nested-name-specifier allowed");
181 assert(DC &&
"given null context");
183 TagDecl *tag = dyn_cast<TagDecl>(DC);
204 diag::err_incomplete_nested_name_spec,
210 if (
auto *EnumD = dyn_cast<EnumDecl>(tag))
233 return !TreatAsComplete;
255 Diag(L, diag::err_incomplete_nested_name_spec)
276 Diag(SuperLoc, diag::err_super_in_lambda_unsupported);
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_no_base_classes) << RD->
getName();
313 if (isa<NamespaceDecl>(SD))
316 if (!isa<TypeDecl>(SD))
322 if (TD->getUnderlyingType()->isRecordType())
324 if (TD->getUnderlyingType()->isEnumeralType()) {
330 }
else if (isa<RecordDecl>(SD)) {
332 }
else if (isa<EnumDecl>(SD)) {
338 if (
auto *TD = dyn_cast<TagDecl>(SD)) {
339 if (TD->isDependentType())
342 ->isDependentType()) {
358 const auto *DNT = dyn_cast<DependentNameType>(
T);
365 assert(!
Found.isAmbiguous() &&
"Cannot handle ambiguities here yet");
367 if (!
Found.isSingleResult())
381class NestedNameSpecifierValidatorCCC final
384 explicit NestedNameSpecifierValidatorCCC(
Sema &SRef)
387 bool ValidateCandidate(
const TypoCorrection &candidate)
override {
391 std::unique_ptr<CorrectionCandidateCallback> clone()
override {
392 return std::make_unique<NestedNameSpecifierValidatorCCC>(*
this);
404 bool ErrorRecoveryLookup,
405 bool *IsCorrectedToColon,
406 bool OnlyNamespace) {
416 bool isDependent =
false;
417 if (IsCorrectedToColon)
418 *IsCorrectedToColon =
false;
419 if (!ObjectType.
isNull()) {
422 assert(!SS.
isSet() &&
"ObjectType and scope specifier cannot coexist");
425 }
else if (SS.
isSet()) {
433 bool ObjectTypeSearchedInScope =
false;
470 else if (ScopeLookupResult)
471 Found.addDecl(ScopeLookupResult);
473 ObjectTypeSearchedInScope =
true;
475 }
else if (!isDependent) {
480 if (
Found.isAmbiguous())
485 if (
Found.empty() && isDependent &&
486 !(LookupCtx && LookupCtx->
isRecord() &&
487 (!cast<CXXRecordDecl>(LookupCtx)->hasDefinition() ||
488 !cast<CXXRecordDecl>(LookupCtx)->hasAnyDependentBases()))) {
490 if (ErrorRecoveryLookup)
512 if (
Found.empty() && !ErrorRecoveryLookup) {
518 else if (S && !isDependent)
525 if (IsCorrectedToColon) {
526 *IsCorrectedToColon =
true;
527 Diag(IdInfo.
CCLoc, diag::err_nested_name_spec_is_not_class)
531 Diag(ND->getLocation(), diag::note_declared_at);
536 ?
unsigned(diag::err_expected_namespace_name)
537 :
unsigned(diag::err_expected_class_or_namespace))
540 Diag(ND->getLocation(), diag::note_entity_declared_at)
551 NestedNameSpecifierValidatorCCC CCC(*
this);
553 Found.getLookupNameInfo(),
Found.getLookupKind(), S, &SS, CCC,
556 bool DroppedSpecifier =
557 Corrected.WillReplaceSpecifier() &&
558 Name.getAsString() == Corrected.getAsString(
getLangOpts());
559 if (DroppedSpecifier)
562 << Name << LookupCtx << DroppedSpecifier
568 if (Corrected.getCorrectionSpecifier())
572 if (
NamedDecl *ND = Corrected.getFoundDecl())
574 Found.setLookupName(Corrected.getCorrection());
581 Found.isSingleResult() ?
Found.getRepresentativeDecl() :
nullptr;
582 bool IsExtension =
false;
584 if (!AcceptSpec && IsExtension) {
589 if (!ObjectType.
isNull() && !ObjectTypeSearchedInScope &&
608 OuterDecl = ScopeLookupResult;
612 (!isa<TypeDecl>(OuterDecl) || !isa<TypeDecl>(SD) ||
616 if (ErrorRecoveryLookup)
620 diag::err_nested_name_member_ref_lookup_ambiguous)
631 if (
auto *TD = dyn_cast_or_null<TypedefNameDecl>(SD))
636 if (ErrorRecoveryLookup)
642 if (
NamespaceDecl *Namespace = dyn_cast<NamespaceDecl>(SD)) {
653 if (isa<EnumDecl>(TD))
658 if (
const auto *USD = dyn_cast<UsingShadowDecl>(SD)) {
664 }
else if (
const auto *Tag = dyn_cast<TagDecl>(TD)) {
671 }
else if (
auto *TN = dyn_cast<TypedefNameDecl>(TD)) {
677 }
else if (
auto *UD = dyn_cast<UnresolvedUsingTypenameDecl>(TD)) {
695 if (ErrorRecoveryLookup)
729 diag::ext_undeclared_unqual_id_with_dependent_base)
740 ContainingClass,
false);
764 if (!
Found.empty()) {
767 if (
auto *TN = dyn_cast<TypedefNameDecl>(TD)) {
772 assert(!isa<TagDecl>(TD));
787 Diag(ND->getLocation(), diag::note_entity_declared_at)
790 }
else if (SS.
isSet())
802 bool *IsCorrectedToColon,
803 bool OnlyNamespace) {
809 IsCorrectedToColon, OnlyNamespace);
856 cast<PackIndexingType>(
Type.getTypePtr())->getPattern(),
866 bool EnteringContext) {
883 bool EnteringContext) {
914 for (
unsigned I = 0, N = TemplateArgs.
size(); I != N; ++I)
924 if (
Template.getAsAssumedTemplateName() &&
929 if (
Template.getAsOverloadedTemplate() || DTN ||
930 isa<FunctionTemplateDecl>(TD) || isa<VarTemplateDecl>(TD)) {
935 Diag(CCLoc, diag::err_non_type_template_in_nested_name_specifier)
936 << isa_and_nonnull<VarTemplateDecl>(TD) <<
Template << R;
944 TemplateNameLoc, TemplateArgs);
951 Diag(TemplateNameLoc, diag::err_nested_name_spec_non_tag) <<
T;
971 struct NestedNameSpecifierAnnotation {
981 (
sizeof(NestedNameSpecifierAnnotation) + SS.
location_size()),
982 alignof(NestedNameSpecifierAnnotation));
983 NestedNameSpecifierAnnotation *Annotation
984 =
new (Mem) NestedNameSpecifierAnnotation;
993 if (!AnnotationPtr) {
998 NestedNameSpecifierAnnotation *Annotation
999 =
static_cast<NestedNameSpecifierAnnotation *
>(AnnotationPtr);
1004 assert(SS.
isSet() &&
"Parser passed invalid CXXScopeSpec.");
1038 llvm_unreachable(
"unexpected null nested name specifier");
1041 llvm_unreachable(
"Invalid NestedNameSpecifier::Kind!");
1045 assert(SS.
isSet() &&
"Parser passed invalid CXXScopeSpec.");
1050 if (!DC)
return true;
1067 assert(SS.
isSet() &&
"Parser passed invalid CXXScopeSpec.");
1071 "exiting declarator scope we never really entered");
Defines the clang::ASTContext interface.
Defines the C++ template declaration subclasses.
Defines the clang::Expr interface and subclasses for C++ expressions.
llvm::MachO::Record Record
Implements a partial diagnostic that can be emitted anwyhere in a DiagnosticBuilder stream.
static CXXRecordDecl * getCurrentInstantiationOf(QualType T, DeclContext *CurContext)
Find the current instantiation that associated with the given type.
__DEVICE__ void * memcpy(void *__a, const void *__b, size_t __c)
TranslationUnitDecl * getTranslationUnitDecl() const
QualType getDependentTemplateSpecializationType(ElaboratedTypeKeyword Keyword, const DependentTemplateStorage &Name, ArrayRef< TemplateArgumentLoc > Args) const
CanQualType getCanonicalType(QualType T) const
Return the canonical (structural) type corresponding to the specified potentially non-canonical type ...
bool hasSameType(QualType T1, QualType T2) const
Determine whether the given types T1 and T2 are equivalent.
QualType getUsingType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier Qualifier, const UsingShadowDecl *D, QualType UnderlyingType=QualType()) const
const LangOptions & getLangOpts() const
QualType getDependentNameType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier NNS, const IdentifierInfo *Name) const
QualType getTypeDeclType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier Qualifier, const TypeDecl *Decl) const
CanQualType getCanonicalTypeDeclType(const TypeDecl *TD) const
void * Allocate(size_t Size, unsigned Align=8) const
QualType getTypedefType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier Qualifier, const TypedefNameDecl *Decl, QualType UnderlyingType=QualType(), std::optional< bool > TypeMatchesDeclOrNone=std::nullopt) const
Return the unique reference to the type for the specified typedef-name decl.
QualType getTagType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier Qualifier, const TagDecl *TD, bool OwnsTag) const
QualType getUnresolvedUsingType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier Qualifier, const UnresolvedUsingTypenameDecl *D) const
CanQualType getCanonicalTagType(const TagDecl *TD) const
Represents a static or instance method of a struct/union/class.
Represents a C++ struct/union/class.
bool hasAnyDependentBases() const
Determine whether this class has any dependent base classes which are not the current instantiation.
unsigned getNumBases() const
Retrieves the number of base classes of this class.
bool hasDefinition() const
Represents a C++ nested-name-specifier or a global scope specifier.
void Make(ASTContext &Context, TypeLoc TL, SourceLocation ColonColonLoc)
Make a nested-name-specifier of the form 'type::'.
char * location_data() const
Retrieve the data associated with the source-location information.
SourceLocation getLastQualifierNameLoc() const
Retrieve the location of the name in the last qualifier in this nested name specifier.
void MakeTrivial(ASTContext &Context, NestedNameSpecifier Qualifier, SourceRange R)
Make a new nested-name-specifier from incomplete source-location information.
SourceRange getRange() const
void MakeGlobal(ASTContext &Context, SourceLocation ColonColonLoc)
Turn this (empty) nested-name-specifier into the global nested-name-specifier '::'.
bool isSet() const
Deprecated.
ArrayRef< TemplateParameterList * > getTemplateParamLists() const
NestedNameSpecifier getScopeRep() const
Retrieve the representation of the nested-name-specifier.
NestedNameSpecifierLoc getWithLocInContext(ASTContext &Context) const
Retrieve a nested-name-specifier with location information, copied into the given AST context.
void SetInvalid(SourceRange R)
Indicate that this nested-name-specifier is invalid.
unsigned location_size() const
Retrieve the size of the data associated with source-location information.
void Extend(ASTContext &Context, NamespaceBaseDecl *Namespace, SourceLocation NamespaceLoc, SourceLocation ColonColonLoc)
Extend the current nested-name-specifier by another nested-name-specifier component of the form 'name...
bool isInvalid() const
An error occurred during parsing of the scope specifier.
void MakeMicrosoftSuper(ASTContext &Context, CXXRecordDecl *RD, SourceLocation SuperLoc, SourceLocation ColonColonLoc)
Turns this (empty) nested-name-specifier into '__super' nested-name-specifier.
bool isEmpty() const
No scope specifier.
void Adopt(NestedNameSpecifierLoc Other)
Adopt an existing nested-name-specifier (with source-range information).
Declaration of a class template.
Base class for callback objects used by Sema::CorrectTypo to check the validity of a potential typo c...
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
DeclContext * getParent()
getParent - Returns the containing DeclContext.
bool isFileContext() const
bool isDependentContext() const
Determines whether this context is dependent on a template parameter.
DeclContext * getRedeclContext()
getRedeclContext - Retrieve the context in which an entity conflicts with other entities of the same ...
bool isFunctionOrMethod() const
Captures information about "declaration specifiers".
TST getTypeSpecType() const
SourceLocation getBeginLoc() const LLVM_READONLY
static const TST TST_typename_pack_indexing
SourceLocation getEllipsisLoc() const
Expr * getRepAsExpr() const
static const TST TST_decltype
SourceLocation getTypeSpecTypeLoc() const
static const TST TST_error
SourceRange getTypeofParensRange() const
SourceLocation getLocation() const
virtual Decl * getCanonicalDecl()
Retrieves the "canonical" declaration of the given declaration.
The name of a declaration.
void setRParenLoc(SourceLocation Loc)
void setDecltypeLoc(SourceLocation Loc)
void setElaboratedKeywordLoc(SourceLocation Loc)
void setQualifierLoc(NestedNameSpecifierLoc QualifierLoc)
void setTemplateKeywordLoc(SourceLocation Loc)
void setElaboratedKeywordLoc(SourceLocation Loc)
void setRAngleLoc(SourceLocation Loc)
void setLAngleLoc(SourceLocation Loc)
void setArgLocInfo(unsigned i, TemplateArgumentLocInfo AI)
void setTemplateNameLoc(SourceLocation Loc)
IdentifierOrOverloadedOperator getName() const
NestedNameSpecifier getQualifier() const
Return the nested name specifier that qualifies this name.
MemberSpecializationInfo * getMemberSpecializationInfo() const
If this enumeration is an instantiation of a member enumeration of a class template specialization,...
EnumDecl * getInstantiatedFromMemberEnum() const
Returns the enumeration (declared within the template) from which this enumeration type was instantia...
static FixItHint CreateReplacement(CharSourceRange RemoveRange, StringRef Code)
Create a code modification hint that replaces the given source range with the given code string.
bool isEditorPlaceholder() const
Return true if this identifier is an editor placeholder.
Represents the results of name lookup.
DeclClass * getAsSingle() const
bool empty() const
Return true if no decls were found.
SourceLocation getNameLoc() const
Gets the location of the identifier.
void suppressDiagnostics()
Suppress the diagnostics that would normally fire because of this lookup.
Provides information a specialization of a member of a class template, which may be a member function...
TemplateSpecializationKind getTemplateSpecializationKind() const
Determine what kind of template specialization this is.
This represents a decl that may have a name.
NamedDecl * getUnderlyingDecl()
Looks through UsingDecls and ObjCCompatibleAliasDecls for the underlying named decl.
StringRef getName() const
Get the name of identifier for this declaration as a StringRef.
Represents a C++ namespace alias.
NamespaceDecl * getNamespace()
Represent a C++ namespace.
A C++ nested-name-specifier augmented with source location information.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
CXXRecordDecl * getAsMicrosoftSuper() const
NamespaceAndPrefix getAsNamespaceAndPrefix() const
bool isDependent() const
Whether this nested name specifier refers to a dependent type or not.
const Type * getAsType() const
@ MicrosoftSuper
Microsoft's '__super' specifier, stored as a CXXRecordDecl* of the class it appeared in.
@ Global
The global specifier '::'. There is no stored value.
@ Type
A type, stored as a Type*.
@ Namespace
A namespace-like entity, stored as a NamespaceBaseDecl*.
void setEllipsisLoc(SourceLocation Loc)
A (possibly-)qualified type.
bool isNull() const
Return true if this QualType doesn't point to a type yet.
Scope - A scope is a transient data structure that is used while parsing the program.
SemaDiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID, bool DeferHint=false)
Emit a diagnostic.
PartialDiagnostic PDiag(unsigned DiagID=0)
Build a partial diagnostic.
Sema - This implements semantic analysis and AST building for C.
bool hasReachableDefinition(NamedDecl *D, NamedDecl **Suggested, bool OnlyNeedComplete=false)
Determine if D has a reachable definition.
Scope * getCurScope() const
Retrieve the parser's current scope.
@ LookupOrdinaryName
Ordinary name lookup, which finds ordinary names (functions, variables, typedefs, etc....
@ LookupNestedNameSpecifierName
Look up of a name that precedes the '::' scope resolution operator in C++.
@ LookupNamespaceName
Look up a namespace name within a C++ using directive or namespace alias definition,...
void NoteAllFoundTemplates(TemplateName Name)
bool RequireCompleteDeclContext(CXXScopeSpec &SS, DeclContext *DC)
Require that the context specified by SS be complete.
bool ActOnCXXNestedNameSpecifierDecltype(CXXScopeSpec &SS, const DeclSpec &DS, SourceLocation ColonColonLoc)
QualType CheckTemplateIdType(ElaboratedTypeKeyword Keyword, TemplateName Template, SourceLocation TemplateLoc, TemplateArgumentListInfo &TemplateArgs)
ASTContext & getASTContext() const
void translateTemplateArguments(const ASTTemplateArgsPtr &In, TemplateArgumentListInfo &Out)
Translates template arguments as provided by the parser into template arguments used by semantic anal...
void * SaveNestedNameSpecifierAnnotation(CXXScopeSpec &SS)
Given a C++ nested-name-specifier, produce an annotation value that the parser can use later to recon...
bool RebuildNestedNameSpecifierInCurrentInstantiation(CXXScopeSpec &SS)
bool ActOnCXXGlobalScopeSpecifier(SourceLocation CCLoc, CXXScopeSpec &SS)
The parser has parsed a global nested-name-specifier '::'.
bool ActOnCXXNestedNameSpecifier(Scope *S, NestedNameSpecInfo &IdInfo, bool EnteringContext, CXXScopeSpec &SS, bool *IsCorrectedToColon=nullptr, bool OnlyNamespace=false)
The parser has parsed a nested-name-specifier 'identifier::'.
const LangOptions & getLangOpts() const
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...
NamedDecl * FindFirstQualifierInScope(Scope *S, NestedNameSpecifier NNS)
If the given nested-name-specifier begins with a bare identifier (e.g., Base::), perform name lookup ...
void ActOnCXXExitDeclaratorScope(Scope *S, const CXXScopeSpec &SS)
ActOnCXXExitDeclaratorScope - Called when a declarator that previously invoked ActOnCXXEnterDeclarato...
sema::LambdaScopeInfo * getCurLambda(bool IgnoreNonLambdaCapturingScope=false)
Retrieve the current lambda scope info, if any.
bool ShouldEnterDeclaratorScope(Scope *S, const CXXScopeSpec &SS)
void MarkAnyDeclReferenced(SourceLocation Loc, Decl *D, bool MightBeOdrUse)
Perform marking for a reference to an arbitrary declaration.
CXXRecordDecl * getCurrentInstantiationOf(NestedNameSpecifier NNS)
If the given nested name specifier refers to the current instantiation, return the declaration that c...
bool ActOnSuperScopeSpecifier(SourceLocation SuperLoc, SourceLocation ColonColonLoc, CXXScopeSpec &SS)
The parser has parsed a '__super' nested-name-specifier.
bool RequireCompleteEnumDecl(EnumDecl *D, SourceLocation L, CXXScopeSpec *SS=nullptr)
Require that the EnumDecl is completed with its enumerators defined or instantiated.
void ExitDeclaratorContext(Scope *S)
std::optional< sema::TemplateDeductionInfo * > isSFINAEContext() const
Determines whether we are currently in a context where template argument substitution failures are no...
DeclContext * CurContext
CurContext - This is the current declaration context of parsing.
MultiLevelTemplateArgumentList getTemplateInstantiationArgs(const NamedDecl *D, const DeclContext *DC=nullptr, bool Final=false, std::optional< ArrayRef< TemplateArgument > > Innermost=std::nullopt, bool RelativeToPrimary=false, const FunctionDecl *Pattern=nullptr, bool ForConstraintInstantiation=false, bool SkipForSpecialization=false, bool ForDefaultArgumentSubstitution=false)
Retrieve the template argument list(s) that should be used to instantiate the definition of 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.
void RestoreNestedNameSpecifierAnnotation(void *Annotation, SourceRange AnnotationRange, CXXScopeSpec &SS)
Given an annotation pointer for a nested-name-specifier, restore the nested-name-specifier structure.
void EnterDeclaratorContext(Scope *S, DeclContext *DC)
EnterDeclaratorContext - Used when we must lookup names in the context of a declarator's nested name ...
bool ActOnCXXNestedNameSpecifierIndexedPack(CXXScopeSpec &SS, const DeclSpec &DS, SourceLocation ColonColonLoc, QualType Type)
DeclContext * computeDeclContext(QualType T)
Compute the DeclContext that is associated with the given type.
void diagnoseMissingImport(SourceLocation Loc, const 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...
bool DiagnoseUseOfDecl(NamedDecl *D, ArrayRef< SourceLocation > Locs, const ObjCInterfaceDecl *UnknownObjCClass=nullptr, bool ObjCPropertyAccess=false, bool AvoidPartialAvailabilityChecks=false, ObjCInterfaceDecl *ClassReciever=nullptr, bool SkipTrailingRequiresClause=false)
Determine whether the use of this declaration is valid, and emit any corresponding diagnostics.
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...
QualType BuildDecltypeType(Expr *E, bool AsUnevaluated=true)
If AsUnevaluated is false, E is treated as though it were an evaluated context, such as when building...
void diagnoseTypo(const TypoCorrection &Correction, const PartialDiagnostic &TypoDiag, bool ErrorRecovery=true)
bool RequireCompleteType(SourceLocation Loc, QualType T, CompleteTypeKind Kind, TypeDiagnoser &Diagnoser)
Ensure that the type T is a complete type.
bool LookupQualifiedName(LookupResult &R, DeclContext *LookupCtx, bool InUnqualifiedLookup=false)
Perform qualified name lookup into a given context.
bool isDependentScopeSpecifier(const CXXScopeSpec &SS)
bool ActOnCXXEnterDeclaratorScope(Scope *S, CXXScopeSpec &SS)
ActOnCXXEnterDeclaratorScope - Called when a C++ scope specifier (global scope or nested-name-specifi...
bool resolveAssumedTemplateNameAsType(Scope *S, TemplateName &Name, SourceLocation NameLoc, bool Diagnose=true)
bool InstantiateEnum(SourceLocation PointOfInstantiation, EnumDecl *Instantiation, EnumDecl *Pattern, const MultiLevelTemplateArgumentList &TemplateArgs, TemplateSpecializationKind TSK)
Instantiate the definition of an enum from a given pattern.
bool LookupName(LookupResult &R, Scope *S, bool AllowBuiltinCreation=false, bool ForceNoCPlusPlus=false)
Perform unqualified name lookup starting from a given scope.
static QualType GetTypeFromParser(ParsedType Ty, TypeSourceInfo **TInfo=nullptr)
bool IsInvalidUnlessNestedName(Scope *S, CXXScopeSpec &SS, NestedNameSpecInfo &IdInfo, bool EnteringContext)
IsInvalidUnlessNestedName - This method is used for error recovery purposes to determine whether the ...
void DiagnoseUnknownTypeName(IdentifierInfo *&II, SourceLocation IILoc, Scope *S, CXXScopeSpec *SS, ParsedType &SuggestedType, bool IsTemplateName=false)
Encodes a location in the source.
bool isValid() const
Return true if this is a valid SourceLocation object.
A trivial tuple used to represent a source range.
void setBegin(SourceLocation b)
SourceLocation getEnd() const
SourceLocation getBegin() const
Represents the declaration of a struct/union/class/enum.
bool isBeingDefined() const
Return true if this decl is currently being defined.
bool isCompleteDefinition() const
Return true if this decl has its body fully specified.
TagDecl * getDefinitionOrSelf() const
void setElaboratedKeywordLoc(SourceLocation Loc)
TagDecl * getOriginalDecl() const
A convenient class for passing around template argument information.
ArrayRef< TemplateArgumentLoc > arguments() const
The base class of all kinds of template declarations (e.g., class, function, etc.).
Represents a C++ template name within the type system.
Stores a list of template parameters for a TemplateDecl and its derived classes.
unsigned getDepth() const
Get the depth of this template parameter list in the set of template parameter lists.
Represents a declaration of a type.
TypeLoc getTypeLocInContext(ASTContext &Context, QualType T)
Copies the type-location information to the given AST context and returns a TypeLoc referring into th...
TyLocType push(QualType T)
Pushes space for a new TypeLoc of the given type.
void clear()
Resets this builder to the newly-initialized state.
TypeSpecTypeLoc pushTypeSpec(QualType T)
Pushes space for a typespec TypeLoc.
void pushTrivial(ASTContext &Context, QualType T, SourceLocation Loc)
Pushes 'T' with all locations pointing to 'Loc'.
void setNameLoc(SourceLocation Loc)
The base class of the type hierarchy.
TagDecl * castAsTagDecl() const
NestedNameSpecifier getPrefix() const
If this type represents a qualified-id, this returns its nested name specifier.
TagDecl * getAsTagDecl() const
Retrieves the TagDecl that this type refers to, either because the type is a TagType or because it is...
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
QualType getCanonicalTypeInternal() const
Base class for declarations which introduce a typedef-name.
Wrapper for source info for typedefs.
Simple class containing the result of Sema::CorrectTypo.
NamedDecl * getCorrectionDecl() const
Gets the pointer to the declaration of the typo correction.
Wrapper for source info for unresolved typename using decls.
Wrapper for source info for types used via transparent aliases.
The JSON file list parser is used to communicate input to InstallAPI.
@ Result
The result type of a method or function.
@ Template
We are parsing a template declaration.
const FunctionProtoType * T
@ TSK_ExplicitSpecialization
This template specialization was declared or defined by an explicit specialization (C++ [temp....
@ TSK_ImplicitInstantiation
This template specialization was implicitly instantiated from a template.
@ None
No keyword precedes the qualified type name.
const IdentifierInfo * getIdentifier() const
Returns the identifier to which this template name refers.
const NamespaceBaseDecl * Namespace
Keeps information about an identifier in a nested-name-spec.
IdentifierInfo * Identifier
The identifier preceding the '::'.
SourceLocation IdentifierLoc
The location of the identifier.
SourceLocation CCLoc
The location of the '::'.
ParsedType ObjectType
The type of the object, if we're parsing nested-name-specifier in a member access expression.