clang API Documentation

Functions
SemaTemplateInstantiateDecl.cpp File Reference
#include "clang/Sema/SemaInternal.h"
#include "clang/AST/ASTConsumer.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/ASTMutationListener.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/AST/DeclVisitor.h"
#include "clang/AST/DependentDiagnostic.h"
#include "clang/AST/Expr.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/TypeLoc.h"
#include "clang/Sema/Lookup.h"
#include "clang/Sema/PrettyDeclStackTrace.h"
#include "clang/Sema/Template.h"
#include "clang/Sema/AttrTemplateInstantiate.inc"
Include dependency graph for SemaTemplateInstantiateDecl.cpp:

Go to the source code of this file.

Functions

static bool isDeclWithinFunction (const Decl *D)
template<typename DeclT >
static bool SubstQualifier (Sema &SemaRef, const DeclT *OldDecl, DeclT *NewDecl, const MultiLevelTemplateArgumentList &TemplateArgs)
static void instantiateDependentAlignedAttr (Sema &S, const MultiLevelTemplateArgumentList &TemplateArgs, const AlignedAttr *Aligned, Decl *New, bool IsPackExpansion)
static void instantiateDependentAlignedAttr (Sema &S, const MultiLevelTemplateArgumentList &TemplateArgs, const AlignedAttr *Aligned, Decl *New)
static void instantiateDependentAssumeAlignedAttr (Sema &S, const MultiLevelTemplateArgumentList &TemplateArgs, const AssumeAlignedAttr *Aligned, Decl *New)
static void instantiateDependentAlignValueAttr (Sema &S, const MultiLevelTemplateArgumentList &TemplateArgs, const AlignValueAttr *Aligned, Decl *New)
static void instantiateDependentEnableIfAttr (Sema &S, const MultiLevelTemplateArgumentList &TemplateArgs, const EnableIfAttr *A, const Decl *Tmpl, Decl *New)
template<typename DeclT >
static DeclT * getPreviousDeclForInstantiation (DeclT *D)
static QualType adjustFunctionTypeForInstantiation (ASTContext &Context, FunctionDecl *D, TypeSourceInfo *TInfo)
 Adjust the given function type for an instantiation of the given declaration, to cope with modifications to the function's type that aren't reflected in the type-source information.
static void collectUnexpandedParameterPacks (Sema &S, TemplateParameterList *Params, SmallVectorImpl< UnexpandedParameterPack > &Unexpanded)
static bool addInstantiatedParametersToScope (Sema &S, FunctionDecl *Function, const FunctionDecl *PatternDecl, LocalInstantiationScope &Scope, const MultiLevelTemplateArgumentList &TemplateArgs)
static bool isInstantiationOf (ClassTemplateDecl *Pattern, ClassTemplateDecl *Instance)
static bool isInstantiationOf (FunctionTemplateDecl *Pattern, FunctionTemplateDecl *Instance)
static bool isInstantiationOf (ClassTemplatePartialSpecializationDecl *Pattern, ClassTemplatePartialSpecializationDecl *Instance)
static bool isInstantiationOf (CXXRecordDecl *Pattern, CXXRecordDecl *Instance)
static bool isInstantiationOf (FunctionDecl *Pattern, FunctionDecl *Instance)
static bool isInstantiationOf (EnumDecl *Pattern, EnumDecl *Instance)
static bool isInstantiationOf (UsingShadowDecl *Pattern, UsingShadowDecl *Instance, ASTContext &C)
static bool isInstantiationOf (UsingDecl *Pattern, UsingDecl *Instance, ASTContext &C)
static bool isInstantiationOf (UnresolvedUsingValueDecl *Pattern, UsingDecl *Instance, ASTContext &C)
static bool isInstantiationOf (UnresolvedUsingTypenameDecl *Pattern, UsingDecl *Instance, ASTContext &C)
static bool isInstantiationOfStaticDataMember (VarDecl *Pattern, VarDecl *Instance)
static bool isInstantiationOf (ASTContext &Ctx, NamedDecl *D, Decl *Other)
template<typename ForwardIterator >
static NamedDecl * findInstantiationOf (ASTContext &Ctx, NamedDecl *D, ForwardIterator first, ForwardIterator last)

Function Documentation

static bool addInstantiatedParametersToScope ( Sema &  S,
FunctionDecl *  Function,
const FunctionDecl *  PatternDecl,
LocalInstantiationScope &  Scope,
const MultiLevelTemplateArgumentList &  TemplateArgs 
) [static]
static QualType adjustFunctionTypeForInstantiation ( ASTContext &  Context,
FunctionDecl *  D,
TypeSourceInfo *  TInfo 
) [static]

Adjust the given function type for an instantiation of the given declaration, to cope with modifications to the function's type that aren't reflected in the type-source information.

Parameters:
DThe declaration we're instantiating.
TInfoThe already-instantiated type.

Definition at line 1286 of file SemaTemplateInstantiateDecl.cpp.

References clang::Type::castAs(), clang::FunctionProtoType::ExtProtoInfo::ExtInfo, clang::FunctionType::getExtInfo(), clang::ASTContext::getFunctionType(), clang::TypeSourceInfo::getType(), and clang::ValueDecl::getType().

Referenced by clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), and clang::TemplateDeclInstantiator::VisitFunctionDecl().

static void collectUnexpandedParameterPacks ( Sema &  S,
TemplateParameterList *  Params,
SmallVectorImpl< UnexpandedParameterPack > &  Unexpanded 
) [static]
template<typename ForwardIterator >
static NamedDecl* findInstantiationOf ( ASTContext &  Ctx,
NamedDecl *  D,
ForwardIterator  first,
ForwardIterator  last 
) [static]

Definition at line 4310 of file SemaTemplateInstantiateDecl.cpp.

References isInstantiationOf().

Referenced by clang::Sema::FindInstantiatedDecl().

template<typename DeclT >
static DeclT* getPreviousDeclForInstantiation ( DeclT *  D) [static]

Get the previous declaration of a declaration for the purposes of template instantiation. If this finds a previous declaration, then the previous declaration of the instantiation of D should be an instantiation of the result of this function.

Definition at line 273 of file SemaTemplateInstantiateDecl.cpp.

Referenced by clang::TemplateDeclInstantiator::InstantiateTypedefNameDecl().

static void instantiateDependentAlignedAttr ( Sema &  S,
const MultiLevelTemplateArgumentList &  TemplateArgs,
const AlignedAttr *  Aligned,
Decl *  New,
bool  IsPackExpansion 
) [static]
static void instantiateDependentAlignedAttr ( Sema &  S,
const MultiLevelTemplateArgumentList &  TemplateArgs,
const AlignedAttr *  Aligned,
Decl *  New 
) [static]
static void instantiateDependentAlignValueAttr ( Sema &  S,
const MultiLevelTemplateArgumentList &  TemplateArgs,
const AlignValueAttr *  Aligned,
Decl *  New 
) [static]
static void instantiateDependentAssumeAlignedAttr ( Sema &  S,
const MultiLevelTemplateArgumentList &  TemplateArgs,
const AssumeAlignedAttr *  Aligned,
Decl *  New 
) [static]
static void instantiateDependentEnableIfAttr ( Sema &  S,
const MultiLevelTemplateArgumentList &  TemplateArgs,
const EnableIfAttr *  A,
const Decl *  Tmpl,
Decl *  New 
) [static]
static bool isDeclWithinFunction ( const Decl *  D) [static]
static bool isInstantiationOf ( ClassTemplateDecl *  Pattern,
ClassTemplateDecl *  Instance 
) [static]
static bool isInstantiationOf ( FunctionTemplateDecl *  Pattern,
FunctionTemplateDecl *  Instance 
) [static]
static bool isInstantiationOf ( CXXRecordDecl *  Pattern,
CXXRecordDecl *  Instance 
) [static]
static bool isInstantiationOf ( FunctionDecl *  Pattern,
FunctionDecl *  Instance 
) [static]
static bool isInstantiationOf ( EnumDecl *  Pattern,
EnumDecl *  Instance 
) [static]
static bool isInstantiationOf ( UsingShadowDecl *  Pattern,
UsingShadowDecl *  Instance,
ASTContext &  C 
) [static]
static bool isInstantiationOf ( UsingDecl *  Pattern,
UsingDecl *  Instance,
ASTContext &  C 
) [static]
static bool isInstantiationOf ( UnresolvedUsingValueDecl *  Pattern,
UsingDecl *  Instance,
ASTContext &  C 
) [static]
static bool isInstantiationOf ( UnresolvedUsingTypenameDecl *  Pattern,
UsingDecl *  Instance,
ASTContext &  C 
) [static]
static bool isInstantiationOf ( ASTContext &  Ctx,
NamedDecl *  D,
Decl *  Other 
) [static]
static bool isInstantiationOfStaticDataMember ( VarDecl *  Pattern,
VarDecl *  Instance 
) [static]
template<typename DeclT >
static bool SubstQualifier ( Sema &  SemaRef,
const DeclT *  OldDecl,
DeclT *  NewDecl,
const MultiLevelTemplateArgumentList &  TemplateArgs 
) [static]