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 "partial specialization scope specifier in SFINAE context?");
135 return RecordT->getDecl();
144 llvm_unreachable(
"Dependent nested-name-specifier has no DeclContext");
155 assert(Tag &&
"Non-tag type in nested-name-specifier");
166 llvm_unreachable(
"Invalid NestedNameSpecifier::Kind!");
183 assert(NNS->
isDependent() &&
"Only dependent nested-name-specifier allowed");
203 assert(DC &&
"given null context");
233 const EnumType *enumType = dyn_cast_or_null<EnumType>(tagType);
246 return !TreatAsComplete;
266 Diag(loc, diag::err_incomplete_nested_name_spec)
283 if (
S->isFunctionScope()) {
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())
392 bool isDependent =
false;
393 if (!ObjectType.
isNull()) {
396 assert(!SS.
isSet() &&
"ObjectType and scope specifier cannot coexist");
399 }
else if (SS.
isSet()) {
419 }
else if (isDependent) {
435 explicit NestedNameSpecifierValidatorCCC(
Sema &SRef)
438 bool ValidateCandidate(
const TypoCorrection &candidate)
override {
486 bool EnteringContext,
489 bool ErrorRecoveryLookup,
490 bool *IsCorrectedToColon) {
496 bool isDependent =
false;
497 if (IsCorrectedToColon)
498 *IsCorrectedToColon =
false;
499 if (!ObjectType.
isNull()) {
502 assert(!SS.
isSet() &&
"ObjectType and scope specifier cannot coexist");
505 }
else if (SS.
isSet()) {
513 bool ObjectTypeSearchedInScope =
false;
550 else if (ScopeLookupResult)
551 Found.
addDecl(ScopeLookupResult);
553 ObjectTypeSearchedInScope =
true;
555 }
else if (!isDependent) {
565 if (Found.
empty() && isDependent &&
566 !(LookupCtx && LookupCtx->
isRecord() &&
568 !cast<CXXRecordDecl>(LookupCtx)->hasAnyDependentBases()))) {
570 if (ErrorRecoveryLookup)
581 if (Found.
empty() && !ErrorRecoveryLookup) {
587 else if (S && !isDependent)
591 R.suppressDiagnostics();
594 if (IsCorrectedToColon) {
595 *IsCorrectedToColon =
true;
596 Diag(CCLoc, diag::err_nested_name_spec_is_not_class)
600 Diag(ND->getLocation(), diag::note_declared_at);
604 Diag(R.getNameLoc(), diag::err_expected_class_or_namespace)
607 Diag(ND->getLocation(), diag::note_entity_declared_at) << &Identifier;
619 llvm::make_unique<NestedNameSpecifierValidatorCCC>(*this),
622 bool DroppedSpecifier =
623 Corrected.WillReplaceSpecifier() &&
625 if (DroppedSpecifier)
628 << Name << LookupCtx << DroppedSpecifier
634 if (Corrected.getCorrectionSpecifier())
635 SS.MakeTrivial(
Context, Corrected.getCorrectionSpecifier(),
638 if (
NamedDecl *ND = Corrected.getFoundDecl())
648 bool IsExtension =
false;
650 if (!AcceptSpec && IsExtension) {
652 Diag(IdentifierLoc, diag::ext_nested_name_spec_is_enum);
655 if (!ObjectType.
isNull() && !ObjectTypeSearchedInScope &&
669 LookupResult FoundOuter(*
this, &Identifier, IdentifierLoc,
674 OuterDecl = ScopeLookupResult;
677 OuterDecl->getCanonicalDecl() != SD->getCanonicalDecl() &&
678 (!isa<TypeDecl>(OuterDecl) || !isa<TypeDecl>(SD) ||
682 if (ErrorRecoveryLookup)
686 diag::err_nested_name_member_ref_lookup_ambiguous)
688 Diag(SD->getLocation(), diag::note_ambig_member_ref_object_type)
690 Diag(OuterDecl->getLocation(), diag::note_ambig_member_ref_scope);
697 if (
auto *TD = dyn_cast_or_null<TypedefNameDecl>(SD))
702 if (ErrorRecoveryLookup)
709 if (
NamespaceDecl *Namespace = dyn_cast<NamespaceDecl>(SD)) {
722 if (isa<InjectedClassNameType>(T)) {
726 }
else if (isa<RecordType>(T)) {
729 }
else if (isa<TypedefType>(T)) {
732 }
else if (isa<EnumType>(T)) {
735 }
else if (isa<TemplateTypeParmType>(T)) {
739 }
else if (isa<UnresolvedUsingType>(T)) {
743 }
else if (isa<SubstTemplateTypeParmType>(T)) {
747 }
else if (isa<SubstTemplateTypeParmPackType>(T)) {
752 llvm_unreachable(
"Unhandled TypeDecl node in nested-name-specifier");
756 Diag(IdentifierLoc, diag::warn_cxx98_compat_enum_nested_name_spec);
765 if (ErrorRecoveryLookup)
798 Diag(IdentifierLoc, diag::ext_undeclared_unqual_id_with_dependent_base)
799 << &Identifier << ContainingClass;
806 if (!Found.
empty()) {
808 Diag(IdentifierLoc, diag::err_expected_class_or_namespace)
811 Diag(IdentifierLoc, diag::err_expected_class_or_namespace)
814 Diag(ND->getLocation(), diag::note_entity_declared_at) << &Identifier;
816 }
else if (SS.
isSet())
817 Diag(IdentifierLoc, diag::err_no_member) << &Identifier << LookupCtx
820 Diag(IdentifierLoc, diag::err_undeclared_var_use) << &Identifier;
830 bool EnteringContext,
832 bool ErrorRecoveryLookup,
833 bool *IsCorrectedToColon) {
853 if (!T->isDependentType() && !T->getAs<
TagType>()) {
878 bool EnteringContext) {
897 bool EnteringContext) {
925 for (
unsigned I = 0, N = TemplateArgs.
size();
I != N; ++
I)
935 isa<FunctionTemplateDecl>(TD) || isa<VarTemplateDecl>(TD)) {
940 Diag(CCLoc, diag::err_non_type_template_in_nested_name_specifier)
941 << (TD && isa<VarTemplateDecl>(TD)) << Template.
get() << R;
956 Diag(TemplateNameLoc, diag::err_nested_name_spec_non_tag) << T;
969 for (
unsigned I = 0, N = TemplateArgs.
size();
I != N; ++
I)
981 struct NestedNameSpecifierAnnotation {
992 llvm::alignOf<NestedNameSpecifierAnnotation>());
993 NestedNameSpecifierAnnotation *Annotation
994 =
new (Mem) NestedNameSpecifierAnnotation;
1003 if (!AnnotationPtr) {
1008 NestedNameSpecifierAnnotation *Annotation
1009 =
static_cast<NestedNameSpecifierAnnotation *
>(AnnotationPtr);
1014 assert(SS.
isSet() &&
"Parser passed invalid CXXScopeSpec.");
1032 switch (Qualifier->getKind()) {
1048 llvm_unreachable(
"Invalid NestedNameSpecifier::Kind!");
1058 assert(SS.
isSet() &&
"Parser passed invalid CXXScopeSpec.");
1063 if (!DC)
return true;
1085 assert(SS.
isSet() &&
"Parser passed invalid CXXScopeSpec.");
1089 "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...
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.
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 hasVisibleDeclaration(const NamedDecl *D, llvm::SmallVectorImpl< Module * > *Modules=nullptr)
Determine whether any declaration of an entity is visible.
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
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.
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.
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 '::'.
SourceLocation getNameLoc() const
Gets the location of the identifier.
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.
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)
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.
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>::".
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
Optional< sema::TemplateDeductionInfo * > isSFINAEContext() const
Determines whether we are currently in a context where template argument substitution failures are no...
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.
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 ':'.
TemplateSpecializationType(TemplateName T, ArrayRef< TemplateArgument > Args, QualType Canon, QualType Aliased)
void clear()
Clears out any current state.