clang
3.9.0
|
#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/TargetInfo.h"
#include "clang/Sema/DeclSpec.h"
#include "clang/Sema/Lookup.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.def"
Go to the source code of this file.
Classes | |
class | ExplicitSpecializationVisibilityChecker |
Walk the path from which a declaration was instantiated, and check that every explicit specialization along that path is visible. More... | |
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 NamedDecl * | isAcceptableTemplateName (ASTContext &Context, NamedDecl *Orig, bool AllowFunctionTemplates) |
Determine whether the declaration found is acceptable as the name of a template and, if so, return that template declaration. More... | |
static TemplateArgumentLoc | translateTemplateArgument (Sema &SemaRef, const ParsedTemplateArgument &Arg) |
static void | maybeDiagnoseTemplateParameterShadow (Sema &SemaRef, Scope *S, SourceLocation Loc, IdentifierInfo *Name) |
static void | SetNestedNameSpecifier (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 | CheckTemplatePartialSpecializationArgs (Sema &S, SourceLocation TemplateNameLoc, TemplateParameterList *TemplateParams, unsigned NumExplicit, SmallVectorImpl< TemplateArgument > &TemplateArgs) |
Check the non-type template arguments of a class template partial specialization according to C++ [temp.class.spec]p9. More... | |
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) |
static TemplateArgumentListInfo | makeTemplateArgumentListInfo (Sema &S, TemplateIdAnnotation &TemplateId) |
Convert the parser's template argument list representation into our form. More... | |
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 bool | diagnoseArityMismatch (Sema &S, TemplateDecl *Template, SourceLocation TemplateLoc, TemplateArgumentListInfo &TemplateArgs) |
Diagnose an arity mismatch in the. 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) |
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 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 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 SourceRange | findTemplateParameter (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... | |
static bool | CheckExplicitInstantiationScope (Sema &S, NamedDecl *D, SourceLocation InstLoc, bool WasQualifiedName) |
Check the scope of an explicit instantiation. More... | |
static bool | ScopeSpecifierHasTemplateId (const CXXScopeSpec &SS) |
Determine whether the given scope specifier has a template-id in it. More... | |
static bool | isEnableIf (NestedNameSpecifierLoc NNS, const IdentifierInfo &II, SourceRange &CondRange) |
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 4046 of file SemaTemplate.cpp.
#define NON_CANONICAL_TYPE | ( | Class, | |
Parent | |||
) | bool Visit##Class##Type(const Class##Type *) { return false; } |
Definition at line 4048 of file SemaTemplate.cpp.
Definition at line 4044 of file SemaTemplate.cpp.
enum NullPointerValueKind |
Enumerator | |
---|---|
NPV_NotNullPointer | |
NPV_NullPointer | |
NPV_Error |
Definition at line 4312 of file SemaTemplate.cpp.
|
static |
Definition at line 2040 of file SemaTemplate.cpp.
References clang::TemplateArgumentListInfo::addArgument(), clang::BTK__make_integer_seq, clang::BTK__type_pack_element, clang::Sema::BuildExpressionFromIntegralTemplateArgument(), clang::Sema::CheckTemplateIdType(), Context, clang::Sema::Diag(), clang::ActionResult< PtrTy, CompressInvalid >::getAs(), clang::TemplateArgument::getAsIntegral(), clang::Sema::getASTContext(), clang::BuiltinTemplateDecl::getBuiltinTemplateKind(), clang::TemplateArgument::getIntegralType(), I, and clang::NumArgs.
Referenced by clang::Sema::CheckTemplateIdType().
|
static |
Check the scope of an explicit instantiation.
Definition at line 7246 of file SemaTemplate.cpp.
References clang::Sema::CurContext, clang::Sema::Diag(), clang::DeclContext::Encloses(), clang::Sema::getLangOpts(), clang::DeclContext::getRedeclContext(), clang::DeclContext::InEnclosingNamespaceSetOf(), and clang::DeclContext::isRecord().
Referenced by clang::Sema::ActOnExplicitInstantiation().
|
static |
Subroutine of Sema::CheckTemplatePartialSpecializationArgs that checks non-type template partial specialization arguments.
Definition at line 6057 of file SemaTemplate.cpp.
References clang::Sema::Diag(), clang::TemplateArgument::Expression, findTemplateParameter(), clang::TemplateArgument::getAsExpr(), clang::SourceRange::getBegin(), clang::TemplateParmPosition::getDepth(), getKind(), clang::ValueDecl::getType(), clang::TypeSourceInfo::getTypeLoc(), clang::DeclaratorDecl::getTypeSourceInfo(), I, clang::SourceRange::isValid(), clang::NumArgs, and clang::TemplateArgument::Pack.
Referenced by 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 4468 of file SemaTemplate.cpp.
References CheckTemplateArgumentIsCompatibleWithParameter(), clang::Sema::Context, clang::FixItHint::CreateInsertion(), clang::FixItHint::CreateRemoval(), clang::Sema::Diag(), clang::ASTContext::getArrayDecayedType(), clang::ASTContext::getCanonicalType(), clang::DeclRefExpr::getDecl(), clang::Expr::getExprLoc(), clang::Sema::getLangOpts(), clang::QualType::getNonReferenceType(), clang::ASTContext::getPointerType(), 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.
Referenced by clang::Sema::CheckTemplateArgument().
|
static |
Checks whether the given template argument is compatible with its template parameter.
Definition at line 4410 of file SemaTemplate.cpp.
References clang::Sema::Context, clang::Sema::Diag(), clang::Type::getAs(), clang::QualType::getCVRQualifiers(), clang::QualType::getNonReferenceType(), 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 4761 of file SemaTemplate.cpp.
References clang::Sema::Context, clang::Sema::Diag(), clang::ASTContext::getCanonicalType(), clang::DeclRefExpr::getDecl(), clang::Expr::getExprLoc(), clang::Sema::getLangOpts(), clang::QualType::getNonReferenceType(), clang::DeclRefExpr::getQualifier(), clang::Expr::getType(), clang::Expr::getValueKind(), clang::ASTContext::hasSameUnqualifiedType(), clang::Expr::IgnoreImpCasts(), clang::Sema::ImpCastExprToType(), isNullPointerValueTemplateArgument(), clang::Sema::IsQualificationConversion(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), NPV_Error, NPV_NotNullPointer, and NPV_NullPointer.
Referenced by clang::Sema::CheckTemplateArgument().
|
static |
Check the non-type template arguments of a class template partial specialization according to C++ [temp.class.spec]p9.
TemplateNameLoc | the location of the template name. |
TemplateParams | the template parameters of the primary class template. |
NumExplicit | the number of explicitly-specified template arguments. |
TemplateArgs | the template arguments of the class template partial specialization. |
true
if there was an error, false
otherwise. Definition at line 6157 of file SemaTemplate.cpp.
References CheckNonTypeTemplatePartialSpecializationArgs(), clang::TemplateParameterList::getParam(), I, and clang::TemplateParameterList::size().
Referenced by clang::Sema::ActOnClassTemplateSpecialization(), and clang::Sema::ActOnVarTemplateSpecialization().
|
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 5886 of file SemaTemplate.cpp.
References clang::Sema::ActiveTemplateInstantiations, clang::Sema::CurContext, Diag(), clang::Sema::Diag(), clang::DeclContext::Encloses(), clang::DeclContext::Equals(), clang::DeclContext::getEnclosingNamespaceContext(), clang::Sema::getLangOpts(), clang::DeclContext::getRedeclContext(), getTemplateSpecializationKind(), clang::DeclContext::InEnclosingNamespaceSetOf(), clang::DeclContext::isFunctionOrMethod(), clang::DeclContext::isRecord(), clang::TSK_ImplicitInstantiation, and clang::TSK_Undeclared.
Referenced by clang::Sema::ActOnClassTemplateSpecialization(), clang::Sema::ActOnVarTemplateSpecialization(), clang::Sema::CheckFunctionTemplateSpecialization(), and clang::Sema::CheckMemberSpecialization().
|
static |
Determines whether a given type depends on the given parameter list.
Definition at line 1601 of file SemaTemplate.cpp.
Referenced by clang::Sema::MatchTemplateParametersToScopeSpecifier().
|
static |
Compute the diagnostic location for an explicit instantiation.
Definition at line 6597 of file SemaTemplate.cpp.
References clang::SourceLocation::isValid().
Referenced by clang::Sema::CheckSpecializationInstantiationRedecl().
|
static |
Diagnose an arity mismatch in the.
Definition at line 3701 of file SemaTemplate.cpp.
References clang::Sema::Diag(), clang::TemplateArgumentListInfo::getRAngleLoc(), clang::TemplateParameterList::getSourceRange(), clang::TemplateDecl::getTemplateParameters(), clang::NumArgs, clang::TemplateParameterList::size(), and clang::TemplateArgumentListInfo::size().
Referenced by clang::Sema::CheckTemplateArgumentList(), and diagnoseMissingArgument().
|
static |
Diagnose the presence of a default template argument on a template parameter, which is ill-formed in certain contexts.
Definition at line 1205 of file SemaTemplate.cpp.
References clang::Sema::Diag(), clang::Sema::getLangOpts(), clang::Sema::TPC_ClassTemplate, clang::Sema::TPC_ClassTemplateMember, clang::Sema::TPC_FriendClassTemplate, clang::Sema::TPC_FriendFunctionTemplate, clang::Sema::TPC_FriendFunctionTemplateDefinition, clang::Sema::TPC_FunctionTemplate, clang::Sema::TPC_TypeAliasTemplate, and clang::Sema::TPC_VarTemplate.
Referenced by clang::Sema::CheckTemplateParameterList().
|
static |
Diagnose a missing template argument.
Definition at line 3752 of file SemaTemplate.cpp.
References clang::Sema::DefaultArgument, diagnoseArityMismatch(), clang::Sema::diagnoseMissingImport(), clang::NamedDecl::getMostRecentDecl(), and clang::Sema::hasVisibleDefaultArgument().
Referenced by clang::Sema::CheckTemplateArgumentList().
|
static |
Diagnose a known arity mismatch when comparing template argument lists.
Definition at line 5688 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 1259 of file SemaTemplate.cpp.
References clang::Sema::DiagnoseUnexpandedParameterPack(), clang::TemplateParameterList::getParam(), clang::TemplateDecl::getTemplateParameters(), I, clang::TemplateTemplateParmDecl::isParameterPack(), P, clang::TemplateParameterList::size(), and clang::Sema::UPPC_NonTypeTemplateParameterType.
Referenced by clang::Sema::CheckTemplateParameterList().
|
static |
Definition at line 6035 of file SemaTemplate.cpp.
References clang::Expr::isInstantiationDependent().
Referenced by CheckNonTypeTemplatePartialSpecializationArgs().
|
static |
Definition at line 6045 of file SemaTemplate.cpp.
References clang::TypeLoc::getSourceRange(), clang::TypeLoc::getType(), and clang::Type::isDependentType().
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 3734 of file SemaTemplate.cpp.
References clang::None.
Referenced by clang::Sema::CheckTemplateArgumentList().
|
static |
Definition at line 1609 of file SemaTemplate.cpp.
References clang::CXXScopeSpec::getScopeRep(), clang::TypeLoc::getSourceRange(), clang::NestedNameSpecifierLoc::getTypeLoc(), clang::ASTContext::hasSameUnqualifiedType(), and clang::CXXScopeSpec::location_data().
Referenced by clang::Sema::MatchTemplateParametersToScopeSpecifier().
|
static |
Determine what kind of template specialization the given declaration is.
Definition at line 5848 of file SemaTemplate.cpp.
References clang::TSK_Undeclared.
Referenced by clang::Sema::ActOnClassTemplateSpecialization(), clang::Sema::ActOnVarTemplateSpecialization(), clang::Sema::CheckMemberSpecialization(), clang::Sema::CheckSpecializationInstantiationRedecl(), CheckTemplateSpecializationScope(), clang::FriendDecl::Create(), clang::Sema::DefineUsedVTables(), clang::FunctionTemplateSpecializationInfo::isExplicitInstantiationOrSpecialization(), clang::ClassTemplateSpecializationDecl::isExplicitInstantiationOrSpecialization(), clang::FunctionTemplateSpecializationInfo::isExplicitSpecialization(), and clang::MemberSpecializationInfo::isExplicitSpecialization().
|
static |
Determine whether the declaration found is acceptable as the name of a template and, if so, return that template declaration.
Otherwise, returns NULL.
Definition at line 51 of file SemaTemplate.cpp.
References clang::NamedDecl::getUnderlyingDecl().
Referenced by clang::Sema::FilterAcceptableTemplateNames(), and clang::Sema::hasAnyAcceptableTemplateNames().
|
static |
Determine whether this failed name lookup should be treated as being disabled by a usage of std::enable_if.
Definition at line 8250 of file SemaTemplate.cpp.
References clang::TemplateSpecializationTypeLoc::getArgLoc(), clang::TypeLoc::getAs(), clang::NestedNameSpecifier::getAsType(), clang::NestedNameSpecifierLoc::getNestedNameSpecifier(), clang::TemplateSpecializationTypeLoc::getNumArgs(), clang::TemplateArgumentLoc::getSourceRange(), clang::NestedNameSpecifierLoc::getTypeLoc(), clang::ConcreteTypeLoc< Base, Derived, TypeClass, LocalData >::getTypePtr(), clang::IdentifierInfo::isStr(), and clang::TemplateSpecializationType().
Referenced by clang::Sema::CheckTypenameType().
|
static |
Determine whether the given template argument is a null pointer value of the appropriate type.
Definition at line 4321 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::Expr::getExprLoc(), clang::Sema::getLangOpts(), clang::Sema::getLocForEndOfToken(), clang::APValue::getLValueBase(), clang::APValue::getMemberPointerDecl(), clang::Expr::getType(), clang::ASTContext::hasSameUnqualifiedType(), clang::Expr::EvalStatus::HasSideEffects, I, 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 clang::Sema::CheckTemplateArgument(), CheckTemplateArgumentAddressOfObjectOrFunction(), and CheckTemplateArgumentPointerToMember().
|
static |
Definition at line 2484 of file SemaTemplate.cpp.
References Depth, clang::TemplateParameterList::getDepth(), clang::TemplateArgument::getKind(), clang::TemplateArgument::getPackExpansionPattern(), clang::TemplateParameterList::getParam(), I, clang::TemplateArgument::isPackExpansion(), isTemplateArgumentTemplateParameter(), clang::TemplateArgument::Pack, clang::TemplateArgument::pack_begin(), clang::TemplateArgument::pack_size(), and clang::TemplateParameterList::size().
Referenced by clang::Sema::ActOnVarTemplateSpecialization().
|
static |
Definition at line 2447 of file SemaTemplate.cpp.
References clang::TemplateArgument::Declaration, clang::TemplateArgument::Expression, clang::Type::getAs(), clang::TemplateArgument::getAsExpr(), clang::TemplateName::getAsTemplateDecl(), clang::TemplateArgument::getAsTemplateOrTemplatePattern(), clang::TemplateArgument::getAsType(), clang::DeclRefExpr::getDecl(), clang::TemplateParmPosition::getDepth(), clang::TemplateTypeParmType::getDepth(), clang::TemplateParmPosition::getIndex(), clang::TemplateTypeParmType::getIndex(), clang::TemplateArgument::getKind(), clang::QualType::hasQualifiers(), clang::TemplateArgument::Integral, clang::TemplateArgument::Null, clang::TemplateArgument::NullPtr, clang::TemplateArgument::Pack, clang::TemplateArgument::Template, clang::TemplateArgument::TemplateExpansion, and clang::TemplateArgument::Type.
Referenced by isSameAsPrimaryTemplate().
|
static |
Convert the parser's template argument list representation into our form.
Definition at line 2512 of file SemaTemplate.cpp.
References clang::TemplateIdAnnotation::getTemplateArgs(), clang::TemplateIdAnnotation::LAngleLoc, clang::TemplateIdAnnotation::NumArgs, clang::TemplateIdAnnotation::RAngleLoc, and clang::Sema::translateTemplateArguments().
Referenced by clang::Sema::ActOnClassTemplateSpecialization(), clang::Sema::ActOnExplicitInstantiation(), and clang::Sema::ActOnVarTemplateSpecialization().
|
static |
Match two template parameters within template parameter lists.
Definition at line 5583 of file SemaTemplate.cpp.
References clang::Sema::Context, clang::Sema::Diag(), clang::TemplateDecl::getTemplateParameters(), clang::ValueDecl::getType(), clang::ASTContext::hasSameType(), clang::Type::isDependentType(), clang::SourceLocation::isValid(), 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 544 of file SemaTemplate.cpp.
References clang::Sema::DiagnoseTemplateParameterShadow(), clang::Sema::ForRedeclaration, clang::Sema::LookupOrdinaryName, and clang::Sema::LookupSingleName().
Referenced by clang::Sema::ActOnNonTypeTemplateParameter(), clang::Sema::ActOnTemplateTemplateParameter(), and clang::Sema::ActOnTypeParameter().
|
static |
Determine whether the given scope specifier has a template-id in it.
Definition at line 7298 of file SemaTemplate.cpp.
References clang::NestedNameSpecifier::getAsType(), clang::NestedNameSpecifier::getPrefix(), clang::CXXScopeSpec::getScopeRep(), and clang::CXXScopeSpec::isSet().
Referenced by clang::Sema::ActOnExplicitInstantiation().
|
static |
Definition at line 842 of file SemaTemplate.cpp.
References clang::CXXScopeSpec::getWithLocInContext(), clang::CXXScopeSpec::isSet(), and clang::TagDecl::setQualifierInfo().
Referenced by clang::Sema::ActOnClassTemplateSpecialization(), clang::Sema::ActOnExplicitInstantiation(), and clang::Sema::CheckClassTemplate().
|
static |
Strips various properties off an implicit instantiation that has just been explicitly specialized.
Definition at line 6587 of file SemaTemplate.cpp.
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 3247 of file SemaTemplate.cpp.
References clang::MultiLevelTemplateArgumentList::addOuterTemplateArguments(), clang::NamedDecl::getDeclName(), clang::TemplateTypeParmDecl::getDefaultArgumentInfo(), clang::TemplateTypeParmDecl::getDefaultArgumentLoc(), clang::TemplateTypeParmDecl::getDepth(), clang::TypeSourceInfo::getType(), clang::Type::isDependentType(), clang::Sema::InstantiatingTemplate::isInvalid(), clang::None, clang::TemplateArgumentList::OnStack, and clang::Sema::SubstType().
Referenced by clang::Sema::CheckTemplateArgumentList(), and 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 3304 of file SemaTemplate.cpp.
References clang::MultiLevelTemplateArgumentList::addOuterTemplateArguments(), clang::Sema::ConstantEvaluated, clang::ExprError(), clang::NonTypeTemplateParmDecl::getDefaultArgument(), clang::TemplateParmPosition::getDepth(), clang::Sema::InstantiatingTemplate::isInvalid(), clang::None, 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 3355 of file SemaTemplate.cpp.
References clang::MultiLevelTemplateArgumentList::addOuterTemplateArguments(), clang::TemplateArgumentLoc::getArgument(), clang::TemplateArgument::getAsTemplate(), clang::TemplateTemplateParmDecl::getDefaultArgument(), clang::TemplateParmPosition::getDepth(), clang::TemplateArgumentLoc::getTemplateNameLoc(), clang::TemplateArgumentLoc::getTemplateQualifierLoc(), clang::Sema::InstantiatingTemplate::isInvalid(), clang::None, clang::TemplateArgumentList::OnStack, clang::Sema::SubstNestedNameSpecifierLoc(), and clang::Sema::SubstTemplateName().
|
static |
Definition at line 500 of file SemaTemplate.cpp.
References clang::Sema::Context, E, 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::ActOnTemplateTemplateParameter(), and clang::Sema::translateTemplateArguments().