clang
10.0.0git
|
#include "TreeTransform.h"
#include "clang/AST/ASTConsumer.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/DeclFriend.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/AST/Expr.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/RecursiveASTVisitor.h"
#include "clang/AST/TypeVisitor.h"
#include "clang/Basic/Builtins.h"
#include "clang/Basic/LangOptions.h"
#include "clang/Basic/PartialDiagnostic.h"
#include "clang/Basic/Stack.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/Sema/DeclSpec.h"
#include "clang/Sema/Lookup.h"
#include "clang/Sema/Overload.h"
#include "clang/Sema/ParsedTemplate.h"
#include "clang/Sema/Scope.h"
#include "clang/Sema/SemaInternal.h"
#include "clang/Sema/Template.h"
#include "clang/Sema/TemplateDeduction.h"
#include "llvm/ADT/SmallBitVector.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringExtras.h"
#include <iterator>
#include "clang/AST/TypeNodes.inc"
Go to the source code of this file.
Macros | |
#define | TYPE(Class, Parent) bool Visit##Class##Type(const Class##Type *); |
#define | ABSTRACT_TYPE(Class, Parent) bool Visit##Class##Type(const Class##Type *) { return false; } |
#define | NON_CANONICAL_TYPE(Class, Parent) bool Visit##Class##Type(const Class##Type *) { return false; } |
Enumerations | |
enum | NullPointerValueKind { NPV_NotNullPointer, NPV_NullPointer, NPV_Error } |
Functions | |
static TemplateArgumentLoc | translateTemplateArgument (Sema &SemaRef, const ParsedTemplateArgument &Arg) |
static void | maybeDiagnoseTemplateParameterShadow (Sema &SemaRef, Scope *S, SourceLocation Loc, IdentifierInfo *Name) |
static TemplateArgumentListInfo | makeTemplateArgumentListInfo (Sema &S, TemplateIdAnnotation &TemplateId) |
Convert the parser's template argument list representation into our form. More... | |
template<typename ArgumentLocAppender > | |
static ExprResult | formImmediatelyDeclaredConstraint (Sema &S, NestedNameSpecifierLoc NS, DeclarationNameInfo NameInfo, ConceptDecl *NamedConcept, SourceLocation LAngleLoc, SourceLocation RAngleLoc, QualType ConstrainedType, SourceLocation ParamNameLoc, ArgumentLocAppender Appender, SourceLocation EllipsisLoc) |
static void | SetNestedNameSpecifier (Sema &S, TagDecl *T, const CXXScopeSpec &SS) |
static bool | DiagnoseDefaultTemplateArgument (Sema &S, Sema::TemplateParamListContext TPC, SourceLocation ParamLoc, SourceRange DefArgRange) |
Diagnose the presence of a default template argument on a template parameter, which is ill-formed in certain contexts. More... | |
static bool | DiagnoseUnexpandedParameterPacks (Sema &S, TemplateTemplateParmDecl *TTP) |
Check for unexpanded parameter packs within the template parameters of a template template parameter, recursively. More... | |
static bool | DependsOnTemplateParameters (QualType T, TemplateParameterList *Params) |
Determines whether a given type depends on the given parameter list. More... | |
static SourceRange | getRangeOfTypeInNestedNameSpecifier (ASTContext &Context, QualType T, const CXXScopeSpec &SS) |
static QualType | checkBuiltinTemplateIdType (Sema &SemaRef, BuiltinTemplateDecl *BTD, const SmallVectorImpl< TemplateArgument > &Converted, SourceLocation TemplateLoc, TemplateArgumentListInfo &TemplateArgs) |
static bool | isEnableIfAliasTemplate (TypeAliasTemplateDecl *AliasTemplate) |
Determine whether this alias template is "enable_if_t". More... | |
static void | collectConjunctionTerms (Expr *Clause, SmallVectorImpl< Expr *> &Terms) |
Collect all of the separable terms in the given condition, which might be a conjunction. More... | |
static Expr * | lookThroughRangesV3Condition (Preprocessor &PP, Expr *Cond) |
static bool | CheckTemplateSpecializationScope (Sema &S, NamedDecl *Specialized, NamedDecl *PrevDecl, SourceLocation Loc, bool IsPartialSpecialization) |
Check whether a specialization is well-formed in the current context. More... | |
static TemplateSpecializationKind | getTemplateSpecializationKind (Decl *D) |
Determine what kind of template specialization the given declaration is. More... | |
static bool | isTemplateArgumentTemplateParameter (const TemplateArgument &Arg, unsigned Depth, unsigned Index) |
static bool | isSameAsPrimaryTemplate (TemplateParameterList *Params, ArrayRef< TemplateArgument > Args) |
template<typename PartialSpecDecl > | |
static void | checkMoreSpecializedThanPrimary (Sema &S, PartialSpecDecl *Partial) |
static void | noteNonDeducibleParameters (Sema &S, TemplateParameterList *TemplateParams, const llvm::SmallBitVector &DeducibleParams) |
template<typename PartialSpecDecl > | |
static void | checkTemplatePartialSpecialization (Sema &S, PartialSpecDecl *Partial) |
static TypeSourceInfo * | SubstDefaultTemplateArgument (Sema &SemaRef, TemplateDecl *Template, SourceLocation TemplateLoc, SourceLocation RAngleLoc, TemplateTypeParmDecl *Param, SmallVectorImpl< TemplateArgument > &Converted) |
Substitute template arguments into the default template argument for the given template type parameter. More... | |
static ExprResult | SubstDefaultTemplateArgument (Sema &SemaRef, TemplateDecl *Template, SourceLocation TemplateLoc, SourceLocation RAngleLoc, NonTypeTemplateParmDecl *Param, SmallVectorImpl< TemplateArgument > &Converted) |
Substitute template arguments into the default template argument for the given non-type template parameter. More... | |
static TemplateName | SubstDefaultTemplateArgument (Sema &SemaRef, TemplateDecl *Template, SourceLocation TemplateLoc, SourceLocation RAngleLoc, TemplateTemplateParmDecl *Param, SmallVectorImpl< TemplateArgument > &Converted, NestedNameSpecifierLoc &QualifierLoc) |
Substitute template arguments into the default template argument for the given template template parameter. More... | |
static TemplateArgumentLoc | convertTypeTemplateArgumentToTemplate (TypeLoc TLoc) |
Convert a template-argument that we parsed as a type into a template, if possible. More... | |
static Optional< unsigned > | getExpandedPackSize (NamedDecl *Param) |
Check whether the template parameter is a pack expansion, and if so, determine the number of parameters produced by that expansion. More... | |
template<typename TemplateParmDecl > | |
static bool | diagnoseMissingArgument (Sema &S, SourceLocation Loc, TemplateDecl *TD, const TemplateParmDecl *D, TemplateArgumentListInfo &Args) |
Diagnose a missing template argument. More... | |
static NullPointerValueKind | isNullPointerValueTemplateArgument (Sema &S, NonTypeTemplateParmDecl *Param, QualType ParamType, Expr *Arg, Decl *Entity=nullptr) |
Determine whether the given template argument is a null pointer value of the appropriate type. More... | |
static bool | CheckTemplateArgumentIsCompatibleWithParameter (Sema &S, NonTypeTemplateParmDecl *Param, QualType ParamType, Expr *ArgIn, Expr *Arg, QualType ArgType) |
Checks whether the given template argument is compatible with its template parameter. More... | |
static bool | CheckTemplateArgumentAddressOfObjectOrFunction (Sema &S, NonTypeTemplateParmDecl *Param, QualType ParamType, Expr *ArgIn, TemplateArgument &Converted) |
Checks whether the given template argument is the address of an object or function according to C++ [temp.arg.nontype]p1. More... | |
static bool | CheckTemplateArgumentPointerToMember (Sema &S, NonTypeTemplateParmDecl *Param, QualType ParamType, Expr *&ResultArg, TemplateArgument &Converted) |
Checks whether the given template argument is a pointer to member constant according to C++ [temp.arg.nontype]p1. More... | |
static void | DiagnoseTemplateParameterListArityMismatch (Sema &S, TemplateParameterList *New, TemplateParameterList *Old, Sema::TemplateParameterListEqualKind Kind, SourceLocation TemplateArgLoc) |
Diagnose a known arity mismatch when comparing template argument lists. More... | |
static bool | MatchTemplateParameterKind (Sema &S, NamedDecl *New, NamedDecl *Old, bool Complain, Sema::TemplateParameterListEqualKind Kind, SourceLocation TemplateArgLoc) |
Match two template parameters within template parameter lists. More... | |
static SourceRange | findTemplateParameterInType (unsigned Depth, Expr *E) |
static SourceRange | findTemplateParameter (unsigned Depth, TypeLoc TL) |
static bool | CheckNonTypeTemplatePartialSpecializationArgs (Sema &S, SourceLocation TemplateNameLoc, NonTypeTemplateParmDecl *Param, const TemplateArgument *Args, unsigned NumArgs, bool IsDefaultArgument) |
Subroutine of Sema::CheckTemplatePartialSpecializationArgs that checks non-type template partial specialization arguments. More... | |
static void | StripImplicitInstantiation (NamedDecl *D) |
Strips various properties off an implicit instantiation that has just been explicitly specialized. More... | |
static SourceLocation | DiagLocForExplicitInstantiation (NamedDecl *D, SourceLocation PointOfInstantiation) |
Compute the diagnostic location for an explicit instantiation. More... | |
template<typename DeclT > | |
static void | completeMemberSpecializationImpl (Sema &S, DeclT *OrigD, SourceLocation Loc) |
Complete the explicit specialization of a member of a class template by updating the instantiated member to be marked as an explicit specialization. More... | |
static bool | CheckExplicitInstantiationScope (Sema &S, NamedDecl *D, SourceLocation InstLoc, bool WasQualifiedName) |
Check the scope of an explicit instantiation. More... | |
static bool | CheckExplicitInstantiation (Sema &S, NamedDecl *D, SourceLocation InstLoc, bool WasQualifiedName, TemplateSpecializationKind TSK) |
Common checks for whether an explicit instantiation of D is valid. More... | |
static bool | ScopeSpecifierHasTemplateId (const CXXScopeSpec &SS) |
Determine whether the given scope specifier has a template-id in it. More... | |
static void | dllExportImportClassTemplateSpecialization (Sema &S, ClassTemplateSpecializationDecl *Def) |
Make a dllexport or dllimport attr on a class template specialization take effect. More... | |
static bool | isEnableIf (NestedNameSpecifierLoc NNS, const IdentifierInfo &II, SourceRange &CondRange, Expr *&Cond) |
Determine whether this failed name lookup should be treated as being disabled by a usage of std::enable_if. More... | |
#define ABSTRACT_TYPE | ( | Class, | |
Parent | |||
) | bool Visit##Class##Type(const Class##Type *) { return false; } |
Definition at line 5710 of file SemaTemplate.cpp.
#define NON_CANONICAL_TYPE | ( | Class, | |
Parent | |||
) | bool Visit##Class##Type(const Class##Type *) { return false; } |
Definition at line 5712 of file SemaTemplate.cpp.
Definition at line 5708 of file SemaTemplate.cpp.
enum NullPointerValueKind |
Enumerator | |
---|---|
NPV_NotNullPointer | |
NPV_NullPointer | |
NPV_Error |
Definition at line 5981 of file SemaTemplate.cpp.
|
static |
Definition at line 3201 of file SemaTemplate.cpp.
|
static |
Common checks for whether an explicit instantiation of D
is valid.
Definition at line 9151 of file SemaTemplate.cpp.
References CheckExplicitInstantiationScope(), clang::Sema::Diag(), clang::NamedDecl::getFormalLinkage(), clang::InternalLinkage, and clang::TSK_ExplicitInstantiationDeclaration.
|
static |
Check the scope of an explicit instantiation.
Definition at line 9099 of file SemaTemplate.cpp.
References clang::Sema::CurContext, clang::Sema::Diag(), clang::DeclContext::Encloses(), clang::Decl::getDeclContext(), clang::DeclContext::getEnclosingNamespaceContext(), clang::Sema::getLangOpts(), clang::Decl::getLocation(), clang::DeclContext::getRedeclContext(), clang::DeclContext::InEnclosingNamespaceSetOf(), and clang::DeclContext::isRecord().
Referenced by CheckExplicitInstantiation().
|
static |
Definition at line 3923 of file SemaTemplate.cpp.
References Diag(), clang::Sema::Diag(), clang::Sema::getDiagnostics(), clang::Sema::isMoreSpecializedThanPrimary(), and clang::Sema::MaybeEmitAmbiguousAtomicConstraintsDiagnostic().
Referenced by checkTemplatePartialSpecialization().
|
static |
Subroutine of Sema::CheckTemplatePartialSpecializationArgs that checks non-type template partial specialization arguments.
Definition at line 7820 of file SemaTemplate.cpp.
References clang::Sema::Diag(), clang::TemplateArgument::Expression, findTemplateParameter(), findTemplateParameterInType(), clang::TemplateArgument::getAsExpr(), clang::SourceRange::getBegin(), clang::Stmt::getBeginLoc(), clang::TemplateParmPosition::getDepth(), getKind(), clang::Decl::getLocation(), clang::ValueDecl::getType(), clang::TypeSourceInfo::getTypeLoc(), clang::DeclaratorDecl::getTypeSourceInfo(), clang::SourceRange::isValid(), and clang::TemplateArgument::Pack.
Referenced by clang::Sema::CheckTemplatePartialSpecializationArgs().
|
static |
Checks whether the given template argument is the address of an object or function according to C++ [temp.arg.nontype]p1.
Definition at line 6143 of file SemaTemplate.cpp.
References CheckTemplateArgumentIsCompatibleWithParameter(), clang::Sema::Context, clang::FixItHint::CreateInsertion(), clang::FixItHint::CreateRemoval(), clang::Sema::Diag(), clang::ASTContext::getArrayDecayedType(), clang::Stmt::getBeginLoc(), clang::ASTContext::getCanonicalType(), clang::DeclRefExpr::getDecl(), clang::Expr::getExprLoc(), clang::Sema::getLangOpts(), clang::Decl::getLocation(), clang::QualType::getNonReferenceType(), clang::ASTContext::getPointerType(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::ValueDecl::getType(), clang::ASTContext::hasSameUnqualifiedType(), clang::Expr::IgnoreImpCasts(), clang::Expr::IgnoreParenCasts(), clang::InternalLinkage, isNullPointerValueTemplateArgument(), clang::Type::isNullPtrType(), clang::Type::isPointerType(), clang::Type::isReferenceType(), clang::SourceLocation::isValid(), clang::Expr::isValueDependent(), clang::Sema::MarkAnyDeclReferenced(), NPV_Error, NPV_NotNullPointer, and NPV_NullPointer.
|
static |
Checks whether the given template argument is compatible with its template parameter.
Definition at line 6085 of file SemaTemplate.cpp.
References clang::Type::castAs(), clang::Sema::Context, clang::Sema::Diag(), clang::Type::getAs(), clang::Stmt::getBeginLoc(), clang::QualType::getCVRQualifiers(), clang::Decl::getLocation(), clang::QualType::getNonReferenceType(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::ASTContext::hasSameUnqualifiedType(), clang::Type::isFunctionType(), clang::Type::isPointerType(), clang::Sema::IsQualificationConversion(), and clang::Type::isReferenceType().
Referenced by CheckTemplateArgumentAddressOfObjectOrFunction().
|
static |
Checks whether the given template argument is a pointer to member constant according to C++ [temp.arg.nontype]p1.
Definition at line 6429 of file SemaTemplate.cpp.
References clang::Sema::Context, clang::Sema::Diag(), clang::Stmt::getBeginLoc(), clang::Decl::getCanonicalDecl(), clang::ASTContext::getCanonicalType(), clang::DeclRefExpr::getDecl(), clang::Expr::getExprLoc(), clang::Sema::getLangOpts(), clang::Decl::getLocation(), clang::QualType::getNonReferenceType(), clang::DeclRefExpr::getQualifier(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::ValueDecl::getType(), clang::Expr::getValueKind(), clang::ASTContext::hasSameUnqualifiedType(), clang::Expr::IgnoreImpCasts(), clang::Sema::ImpCastExprToType(), clang::Type::isMemberPointerType(), isNullPointerValueTemplateArgument(), clang::Sema::IsQualificationConversion(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), NPV_Error, NPV_NotNullPointer, and NPV_NullPointer.
|
static |
Definition at line 3975 of file SemaTemplate.cpp.
References checkMoreSpecializedThanPrimary(), clang::Sema::Diag(), clang::Sema::MarkUsedTemplateParameters(), and noteNonDeducibleParameters().
Referenced by clang::Sema::CheckTemplatePartialSpecialization().
|
static |
Check whether a specialization is well-formed in the current context.
This routine determines whether a template specialization can be declared in the current context (C++ [temp.expl.spec]p2).
S | the semantic analysis object for which this check is being performed. |
Specialized | the entity being specialized or instantiated, which may be a kind of template (class template, function template, etc.) or a member of a class template (member function, static data member, member class). |
PrevDecl | the previous declaration of this entity, if any. |
Loc | the location of the explicit specialization or instantiation of this entity. |
IsPartialSpecialization | whether this is a partial specialization of a class template. |
Definition at line 7726 of file SemaTemplate.cpp.
References clang::Sema::CurContext, Diag(), clang::Sema::Diag(), clang::DeclContext::Encloses(), clang::DeclContext::Equals(), clang::Decl::getDeclContext(), clang::Sema::getLangOpts(), clang::Decl::getLocation(), clang::DeclContext::getRedeclContext(), clang::DeclContext::isFileContext(), clang::DeclContext::isFunctionOrMethod(), and clang::DeclContext::isRecord().
|
static |
Collect all of the separable terms in the given condition, which might be a conjunction.
FIXME: The right answer is to convert the logical expression into disjunctive normal form, so we can find the first failed term within each possible clause.
Definition at line 3283 of file SemaTemplate.cpp.
References clang::Expr::IgnoreParenImpCasts().
Referenced by clang::Sema::findFailedBooleanCondition().
|
static |
Complete the explicit specialization of a member of a class template by updating the instantiated member to be marked as an explicit specialization.
OrigD | The member declaration instantiated from the template. |
Loc | The location of the explicit specialization of the member. |
Definition at line 9065 of file SemaTemplate.cpp.
References clang::TSK_ExplicitSpecialization, and clang::TSK_ImplicitInstantiation.
Referenced by clang::Sema::CompleteMemberSpecialization().
|
static |
Convert a template-argument that we parsed as a type into a template, if possible.
C++ permits injected-class-names to perform dual service as template template arguments and as template type arguments.
Definition at line 5041 of file SemaTemplate.cpp.
References clang::ETK_None, and clang::TypeLoc::getAs().
|
static |
Determines whether a given type depends on the given parameter list.
Definition at line 2753 of file SemaTemplate.cpp.
References clang::TemplateParameterList::size().
|
static |
Compute the diagnostic location for an explicit instantiation.
Definition at line 8384 of file SemaTemplate.cpp.
References clang::SourceLocation::isValid().
Referenced by clang::Sema::CheckSpecializationInstantiationRedecl().
|
static |
Diagnose the presence of a default template argument on a template parameter, which is ill-formed in certain contexts.
Definition at line 2307 of file SemaTemplate.cpp.
Referenced by clang::Sema::CheckTemplateParameterList().
|
static |
Diagnose a missing template argument.
Definition at line 5378 of file SemaTemplate.cpp.
References clang::Sema::DefaultArgument, clang::Sema::Diag(), clang::Sema::diagnoseMissingImport(), clang::Decl::getLocation(), clang::NamedDecl::getMostRecentDecl(), clang::TemplateParameterList::getSourceRange(), clang::Sema::getTemplateNameKindForDiagnostics(), clang::TemplateDecl::getTemplateParameters(), and clang::Sema::hasVisibleDefaultArgument().
|
static |
Diagnose a known arity mismatch when comparing template argument lists.
Definition at line 7496 of file SemaTemplate.cpp.
References clang::Sema::Diag(), clang::TemplateParameterList::getRAngleLoc(), clang::TemplateParameterList::getTemplateLoc(), clang::SourceLocation::isValid(), clang::TemplateParameterList::size(), and clang::Sema::TPL_TemplateMatch.
Referenced by clang::Sema::TemplateParameterListsAreEqual().
|
static |
Check for unexpanded parameter packs within the template parameters of a template template parameter, recursively.
Definition at line 2361 of file SemaTemplate.cpp.
Referenced by clang::Sema::checkExceptionSpecification(), and clang::Sema::DiagnoseUnexpandedParameterPack().
|
static |
Make a dllexport or dllimport attr on a class template specialization take effect.
Definition at line 9196 of file SemaTemplate.cpp.
References clang::CXXRecordDecl::bases(), clang::Sema::checkClassLevelDLLAttribute(), clang::Sema::DelayedDllExportClasses, clang::TypeDecl::getBeginLoc(), clang::getDLLAttr(), clang::Sema::propagateDLLAttrToBaseClassTemplate(), and clang::Sema::referenceDLLExportedClassMethods().
|
static |
Definition at line 7808 of file SemaTemplate.cpp.
References clang::TypeLoc::getSourceRange(), clang::TypeLoc::getType(), and clang::Type::isDependentType().
Referenced by CheckNonTypeTemplatePartialSpecializationArgs().
|
static |
Definition at line 7798 of file SemaTemplate.cpp.
References clang::Stmt::getSourceRange(), and clang::Expr::isTypeDependent().
Referenced by CheckNonTypeTemplatePartialSpecializationArgs().
|
static |
Definition at line 1092 of file SemaTemplate.cpp.
Referenced by clang::Sema::AttachTypeConstraint().
Check whether the template parameter is a pack expansion, and if so, determine the number of parameters produced by that expansion.
For instance:
In A<int,int>::B
, NTs
and TTs
have expanded pack size 2, and Us
is not a pack expansion, so returns an empty Optional.
Definition at line 5354 of file SemaTemplate.cpp.
Referenced by clang::Sema::CheckTemplateArgumentList().
|
static |
Definition at line 2764 of file SemaTemplate.cpp.
|
static |
Determine what kind of template specialization the given declaration is.
Definition at line 7688 of file SemaTemplate.cpp.
References clang::TSK_Undeclared.
Referenced by clang::Sema::CheckSpecializationInstantiationRedecl(), clang::FriendDecl::Create(), clang::EnumDecl::getTemplateInstantiationPattern(), getThreadLocalWrapperLinkage(), clang::EnumDecl::isComplete(), clang::FunctionTemplateSpecializationInfo::isExplicitInstantiationOrSpecialization(), clang::ClassTemplateSpecializationDecl::isExplicitInstantiationOrSpecialization(), clang::VarTemplateSpecializationDecl::isExplicitInstantiationOrSpecialization(), clang::FunctionTemplateSpecializationInfo::isExplicitSpecialization(), clang::MemberSpecializationInfo::isExplicitSpecialization(), clang::CXXRecordDecl::isLiteral(), and clang::VarDecl::setEscapingByref().
|
static |
Determine whether this failed name lookup should be treated as being disabled by a usage of std::enable_if.
Definition at line 10178 of file SemaTemplate.cpp.
References clang::TemplateArgument::Expression, clang::TemplateSpecializationTypeLoc::getArgLoc(), clang::TemplateArgumentLoc::getArgument(), clang::TypeLoc::getAs(), clang::DeclarationName::getAsIdentifierInfo(), clang::TemplateName::getAsTemplateDecl(), clang::NestedNameSpecifier::getAsType(), clang::NamedDecl::getDeclName(), clang::TemplateArgument::getKind(), clang::NestedNameSpecifierLoc::getNestedNameSpecifier(), clang::TemplateSpecializationTypeLoc::getNumArgs(), clang::TemplateArgumentLoc::getSourceExpression(), clang::TemplateArgumentLoc::getSourceRange(), clang::TemplateSpecializationType::getTemplateName(), clang::NestedNameSpecifierLoc::getTypeLoc(), clang::ConcreteTypeLoc< Base, Derived, TypeClass, LocalData >::getTypePtr(), clang::Expr::IgnoreParenCasts(), clang::Type::isIncompleteType(), and clang::IdentifierInfo::isStr().
|
static |
Determine whether this alias template is "enable_if_t".
Definition at line 3273 of file SemaTemplate.cpp.
References clang::NamedDecl::getName().
|
static |
Determine whether the given template argument is a null pointer value of the appropriate type.
Definition at line 5990 of file SemaTemplate.cpp.
References clang::Sema::Context, clang::FixItHint::CreateInsertion(), clang::Sema::DefaultFunctionArrayConversion(), clang::Expr::EvalStatus::Diag, clang::Sema::Diag(), clang::Expr::EvaluateAsRValue(), clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::QualType::getAsString(), clang::Stmt::getBeginLoc(), clang::Stmt::getEndLoc(), clang::Expr::getExprLoc(), clang::Sema::getLangOpts(), clang::Decl::getLocation(), clang::Sema::getLocForEndOfToken(), clang::APValue::getLValueBase(), clang::APValue::getMemberPointerDecl(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::ASTContext::hasSameUnqualifiedType(), clang::Expr::EvalStatus::HasSideEffects, clang::Sema::isCompleteType(), clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), clang::APValue::isLValue(), clang::APValue::isMemberPointer(), clang::Expr::isNullPointerConstant(), clang::Type::isNullPtrType(), clang::Sema::IsQualificationConversion(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), clang::Expr::NPC_NeverValueDependent, NPV_Error, NPV_NotNullPointer, NPV_NullPointer, and clang::Expr::EvalResult::Val.
Referenced by CheckTemplateArgumentAddressOfObjectOrFunction(), and CheckTemplateArgumentPointerToMember().
|
static |
Definition at line 3896 of file SemaTemplate.cpp.
References Depth, clang::TemplateParameterList::getDepth(), clang::TemplateArgument::getKind(), clang::TemplateArgument::getPackExpansionPattern(), clang::TemplateParameterList::getParam(), clang::TemplateArgument::isPackExpansion(), clang::Decl::isParameterPack(), isTemplateArgumentTemplateParameter(), clang::TemplateArgument::Pack, clang::TemplateArgument::pack_begin(), clang::TemplateArgument::pack_size(), and clang::TemplateParameterList::size().
|
static |
Definition at line 3859 of file SemaTemplate.cpp.
Referenced by isSameAsPrimaryTemplate().
|
static |
Definition at line 3300 of file SemaTemplate.cpp.
References clang::Preprocessor::getImmediateMacroName(), clang::NamedDecl::getName(), clang::DeclRefExpr::getQualifier(), clang::Expr::IgnoreParenImpCasts(), clang::SourceLocation::isMacroID(), P, clang::NestedNameSpecifier::print(), and clang::printTemplateArgumentList().
Referenced by clang::Sema::findFailedBooleanCondition().
|
static |
Convert the parser's template argument list representation into our form.
Definition at line 1044 of file SemaTemplate.cpp.
Referenced by clang::Sema::ActOnTypeConstraint(), and clang::Sema::ActOnVarTemplateSpecialization().
|
static |
Match two template parameters within template parameter lists.
Definition at line 7365 of file SemaTemplate.cpp.
References clang::Sema::Context, clang::Sema::Diag(), clang::Decl::getBeginLoc(), clang::Stmt::getBeginLoc(), clang::Decl::getKind(), clang::Decl::getLocation(), clang::TemplateDecl::getTemplateParameters(), clang::ValueDecl::getType(), clang::ASTContext::hasSameType(), clang::Type::isDependentType(), clang::Decl::isParameterPack(), clang::Decl::isTemplateParameterPack(), clang::SourceLocation::isValid(), clang::Stmt::Profile(), clang::Sema::TemplateParameterListsAreEqual(), clang::Sema::TPL_TemplateMatch, clang::Sema::TPL_TemplateTemplateArgumentMatch, and clang::Sema::TPL_TemplateTemplateParmMatch.
Referenced by clang::Sema::TemplateParameterListsAreEqual().
|
static |
Definition at line 910 of file SemaTemplate.cpp.
|
static |
Definition at line 3958 of file SemaTemplate.cpp.
References clang::Sema::Diag(), clang::NamedDecl::getDeclName(), clang::Decl::getLocation(), and clang::TemplateParameterList::getParam().
Referenced by clang::Sema::CheckDeductionGuideTemplate(), and checkTemplatePartialSpecialization().
|
static |
Determine whether the given scope specifier has a template-id in it.
Definition at line 9174 of file SemaTemplate.cpp.
References clang::NestedNameSpecifier::getAsType(), clang::NestedNameSpecifier::getPrefix(), clang::CXXScopeSpec::getScopeRep(), and clang::CXXScopeSpec::isSet().
|
static |
Definition at line 1518 of file SemaTemplate.cpp.
|
static |
Strips various properties off an implicit instantiation that has just been explicitly specialized.
Definition at line 8374 of file SemaTemplate.cpp.
References clang::Decl::dropAttr().
Referenced by clang::Sema::CheckSpecializationInstantiationRedecl().
|
static |
Substitute template arguments into the default template argument for the given template type parameter.
SemaRef | the semantic analysis object for which we are performing the substitution. |
Template | the template that we are synthesizing template arguments for. |
TemplateLoc | the location of the template name that started the template-id we are checking. |
RAngleLoc | the location of the right angle bracket ('>') that terminates the template-id. |
Param | the template template parameter whose default we are substituting into. |
Converted | the list of template arguments provided for template parameters that precede Param in the template parameter list. |
Definition at line 4823 of file SemaTemplate.cpp.
References clang::MultiLevelTemplateArgumentList::addOuterTemplateArguments(), clang::Decl::getDeclContext(), clang::NamedDecl::getDeclName(), clang::TemplateTypeParmDecl::getDefaultArgumentInfo(), clang::TemplateTypeParmDecl::getDefaultArgumentLoc(), clang::TemplateTypeParmDecl::getDepth(), clang::TypeSourceInfo::getType(), clang::Type::isInstantiationDependentType(), clang::Sema::InstantiatingTemplate::isInvalid(), clang::TemplateArgumentList::OnStack, and clang::Sema::SubstType().
Referenced by clang::Sema::SubstDefaultTemplateArgumentIfAvailable().
|
static |
Substitute template arguments into the default template argument for the given non-type template parameter.
SemaRef | the semantic analysis object for which we are performing the substitution. |
Template | the template that we are synthesizing template arguments for. |
TemplateLoc | the location of the template name that started the template-id we are checking. |
RAngleLoc | the location of the right angle bracket ('>') that terminates the template-id. |
Param | the non-type template parameter whose default we are substituting into. |
Converted | the list of template arguments provided for template parameters that precede Param in the template parameter list. |
Definition at line 4880 of file SemaTemplate.cpp.
References clang::MultiLevelTemplateArgumentList::addOuterTemplateArguments(), clang::Sema::ConstantEvaluated, clang::ExprError(), clang::Decl::getDeclContext(), clang::NonTypeTemplateParmDecl::getDefaultArgument(), clang::TemplateParmPosition::getDepth(), clang::Sema::InstantiatingTemplate::isInvalid(), clang::TemplateArgumentList::OnStack, and clang::Sema::SubstExpr().
|
static |
Substitute template arguments into the default template argument for the given template template parameter.
SemaRef | the semantic analysis object for which we are performing the substitution. |
Template | the template that we are synthesizing template arguments for. |
TemplateLoc | the location of the template name that started the template-id we are checking. |
RAngleLoc | the location of the right angle bracket ('>') that terminates the template-id. |
Param | the template template parameter whose default we are substituting into. |
Converted | the list of template arguments provided for template parameters that precede Param in the template parameter list. |
QualifierLoc | Will be set to the nested-name-specifier (with source-location information) that precedes the template name. |
Definition at line 4932 of file SemaTemplate.cpp.
References clang::MultiLevelTemplateArgumentList::addOuterTemplateArguments(), clang::TemplateArgumentLoc::getArgument(), clang::TemplateArgument::getAsTemplate(), clang::Decl::getDeclContext(), clang::TemplateTemplateParmDecl::getDefaultArgument(), clang::TemplateParmPosition::getDepth(), clang::TemplateArgumentLoc::getTemplateNameLoc(), clang::TemplateArgumentLoc::getTemplateQualifierLoc(), clang::Sema::InstantiatingTemplate::isInvalid(), clang::TemplateArgumentList::OnStack, clang::Sema::SubstNestedNameSpecifierLoc(), and clang::Sema::SubstTemplateName().
|
static |
Definition at line 866 of file SemaTemplate.cpp.
References clang::Sema::Context, clang::OpaquePtr< PtrTy >::get(), clang::ParsedTemplateArgument::getAsExpr(), clang::ParsedTemplateArgument::getAsTemplate(), clang::ParsedTemplateArgument::getAsType(), clang::ParsedTemplateArgument::getEllipsisLoc(), clang::ParsedTemplateArgument::getKind(), clang::ParsedTemplateArgument::getLocation(), clang::ParsedTemplateArgument::getScopeSpec(), clang::ASTContext::getTrivialTypeSourceInfo(), clang::Sema::GetTypeFromParser(), clang::CXXScopeSpec::getWithLocInContext(), clang::SourceLocation::isValid(), clang::ParsedTemplateArgument::NonType, clang::ParsedTemplateArgument::Template, and clang::ParsedTemplateArgument::Type.
Referenced by clang::Sema::translateTemplateArguments().