clang API Documentation
#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"
Go to the source code of this file.
| static bool addInstantiatedParametersToScope | ( | Sema & | S, |
| FunctionDecl * | Function, | ||
| const FunctionDecl * | PatternDecl, | ||
| LocalInstantiationScope & | Scope, | ||
| const MultiLevelTemplateArgumentList & | TemplateArgs | ||
| ) | [static] |
Introduce the instantiated function parameters into the local instantiation scope, and set the parameter names to those used in the template.
Definition at line 3063 of file SemaTemplateInstantiateDecl.cpp.
References clang::Type::castAs(), clang::NamedDecl::getDeclName(), clang::Decl::getLocation(), clang::Sema::getNumArgumentsInExpansion(), clang::FunctionDecl::getNumParams(), clang::FunctionDecl::getParamDecl(), clang::ValueDecl::getType(), clang::LocalInstantiationScope::InstantiatedLocal(), clang::LocalInstantiationScope::InstantiatedLocalPackArg(), clang::Type::isDependentType(), clang::QualType::isNull(), clang::ParmVarDecl::isParameterPack(), clang::LocalInstantiationScope::MakeInstantiatedLocalArgPack(), clang::NamedDecl::setDeclName(), clang::ValueDecl::setType(), and clang::Sema::SubstType().
Referenced by clang::Sema::InstantiateExceptionSpec(), and clang::Sema::InstantiateFunctionDefinition().
| 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.
| D | The declaration we're instantiating. |
| TInfo | The 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] |
Definition at line 2048 of file SemaTemplateInstantiateDecl.cpp.
References clang::TemplateParameterList::begin(), clang::Sema::collectUnexpandedParameterPacks(), and clang::TemplateParameterList::end().
| 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().
| 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] |
Definition at line 78 of file SemaTemplateInstantiateDecl.cpp.
References clang::Sema::AddAlignedAttr(), clang::Sema::ConstantEvaluated, clang::ActionResult< PtrTy, CompressInvalid >::getAs(), clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), clang::Sema::SubstExpr(), and clang::Sema::SubstType().
Referenced by clang::Sema::InstantiateAttrs(), and instantiateDependentAlignedAttr().
| static void instantiateDependentAlignedAttr | ( | Sema & | S, |
| const MultiLevelTemplateArgumentList & | TemplateArgs, | ||
| const AlignedAttr * | Aligned, | ||
| Decl * | New | ||
| ) | [static] |
Definition at line 98 of file SemaTemplateInstantiateDecl.cpp.
References clang::Sema::CheckParameterPacksForExpansion(), clang::Sema::collectUnexpandedParameterPacks(), and instantiateDependentAlignedAttr().
| static void instantiateDependentAlignValueAttr | ( | Sema & | S, |
| const MultiLevelTemplateArgumentList & | TemplateArgs, | ||
| const AlignValueAttr * | Aligned, | ||
| Decl * | New | ||
| ) | [static] |
Definition at line 159 of file SemaTemplateInstantiateDecl.cpp.
References clang::Sema::AddAlignValueAttr(), clang::Sema::ConstantEvaluated, clang::ActionResult< PtrTy, CompressInvalid >::getAs(), clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), and clang::Sema::SubstExpr().
Referenced by clang::Sema::InstantiateAttrs().
| static void instantiateDependentAssumeAlignedAttr | ( | Sema & | S, |
| const MultiLevelTemplateArgumentList & | TemplateArgs, | ||
| const AssumeAlignedAttr * | Aligned, | ||
| Decl * | New | ||
| ) | [static] |
Definition at line 136 of file SemaTemplateInstantiateDecl.cpp.
References clang::Sema::AddAssumeAlignedAttr(), clang::Sema::ConstantEvaluated, clang::ActionResult< PtrTy, CompressInvalid >::getAs(), clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), and clang::Sema::SubstExpr().
Referenced by clang::Sema::InstantiateAttrs().
| static void instantiateDependentEnableIfAttr | ( | Sema & | S, |
| const MultiLevelTemplateArgumentList & | TemplateArgs, | ||
| const EnableIfAttr * | A, | ||
| const Decl * | Tmpl, | ||
| Decl * | New | ||
| ) | [static] |
Definition at line 170 of file SemaTemplateInstantiateDecl.cpp.
References clang::Decl::addAttr(), clang::Sema::Diag(), clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::ActionResult< PtrTy, CompressInvalid >::getAs(), clang::Sema::getASTContext(), clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), clang::Expr::isPotentialConstantExprUnevaluated(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), clang::Sema::PerformContextuallyConvertToBool(), clang::Sema::SubstExpr(), and clang::Sema::Unevaluated.
Referenced by clang::Sema::InstantiateAttrs().
| static bool isDeclWithinFunction | ( | const Decl * | D | ) | [static] |
Definition at line 28 of file SemaTemplateInstantiateDecl.cpp.
References clang::Decl::getDeclContext(), clang::DeclContext::isFunctionOrMethod(), and clang::DeclContext::isRecord().
| static bool isInstantiationOf | ( | ClassTemplateDecl * | Pattern, |
| ClassTemplateDecl * | Instance | ||
| ) | [static] |
Definition at line 4125 of file SemaTemplateInstantiateDecl.cpp.
References clang::ClassTemplateDecl::getCanonicalDecl(), and clang::ClassTemplateDecl::getInstantiatedFromMemberTemplate().
Referenced by clang::Sema::FindInstantiatedDecl(), findInstantiationOf(), and isInstantiationOf().
| static bool isInstantiationOf | ( | FunctionTemplateDecl * | Pattern, |
| FunctionTemplateDecl * | Instance | ||
| ) | [static] |
Definition at line 4138 of file SemaTemplateInstantiateDecl.cpp.
References clang::FunctionTemplateDecl::getCanonicalDecl(), and clang::FunctionTemplateDecl::getInstantiatedFromMemberTemplate().
| static bool isInstantiationOf | ( | ClassTemplatePartialSpecializationDecl * | Pattern, |
| ClassTemplatePartialSpecializationDecl * | Instance | ||
| ) | [static] |
Definition at line 4152 of file SemaTemplateInstantiateDecl.cpp.
References clang::CXXRecordDecl::getCanonicalDecl(), and clang::ClassTemplatePartialSpecializationDecl::getInstantiatedFromMember().
| static bool isInstantiationOf | ( | CXXRecordDecl * | Pattern, |
| CXXRecordDecl * | Instance | ||
| ) | [static] |
Definition at line 4167 of file SemaTemplateInstantiateDecl.cpp.
References clang::CXXRecordDecl::getCanonicalDecl(), and clang::CXXRecordDecl::getInstantiatedFromMemberClass().
| static bool isInstantiationOf | ( | FunctionDecl * | Pattern, |
| FunctionDecl * | Instance | ||
| ) | [static] |
Definition at line 4180 of file SemaTemplateInstantiateDecl.cpp.
References clang::FunctionDecl::getCanonicalDecl(), and clang::FunctionDecl::getInstantiatedFromMemberFunction().
| static bool isInstantiationOf | ( | EnumDecl * | Pattern, |
| EnumDecl * | Instance | ||
| ) | [static] |
Definition at line 4193 of file SemaTemplateInstantiateDecl.cpp.
References clang::EnumDecl::getCanonicalDecl(), and clang::EnumDecl::getInstantiatedFromMemberEnum().
| static bool isInstantiationOf | ( | UsingShadowDecl * | Pattern, |
| UsingShadowDecl * | Instance, | ||
| ASTContext & | C | ||
| ) | [static] |
Definition at line 4206 of file SemaTemplateInstantiateDecl.cpp.
References clang::declaresSameEntity(), and clang::ASTContext::getInstantiatedFromUsingShadowDecl().
| static bool isInstantiationOf | ( | UsingDecl * | Pattern, |
| UsingDecl * | Instance, | ||
| ASTContext & | C | ||
| ) | [static] |
Definition at line 4213 of file SemaTemplateInstantiateDecl.cpp.
References clang::declaresSameEntity(), and clang::ASTContext::getInstantiatedFromUsingDecl().
| static bool isInstantiationOf | ( | UnresolvedUsingValueDecl * | Pattern, |
| UsingDecl * | Instance, | ||
| ASTContext & | C | ||
| ) | [static] |
Definition at line 4219 of file SemaTemplateInstantiateDecl.cpp.
References clang::declaresSameEntity(), and clang::ASTContext::getInstantiatedFromUsingDecl().
| static bool isInstantiationOf | ( | UnresolvedUsingTypenameDecl * | Pattern, |
| UsingDecl * | Instance, | ||
| ASTContext & | C | ||
| ) | [static] |
Definition at line 4225 of file SemaTemplateInstantiateDecl.cpp.
References clang::declaresSameEntity(), and clang::ASTContext::getInstantiatedFromUsingDecl().
| static bool isInstantiationOf | ( | ASTContext & | Ctx, |
| NamedDecl * | D, | ||
| Decl * | Other | ||
| ) | [static] |
Definition at line 4248 of file SemaTemplateInstantiateDecl.cpp.
References clang::declaresSameEntity(), clang::NamedDecl::getDeclName(), clang::ASTContext::getInstantiatedFromUnnamedFieldDecl(), clang::Decl::getKind(), isInstantiationOf(), isInstantiationOfStaticDataMember(), and clang::VarDecl::isStaticDataMember().
| static bool isInstantiationOfStaticDataMember | ( | VarDecl * | Pattern, |
| VarDecl * | Instance | ||
| ) | [static] |
Definition at line 4231 of file SemaTemplateInstantiateDecl.cpp.
References clang::VarDecl::getCanonicalDecl(), clang::VarDecl::getInstantiatedFromStaticDataMember(), and clang::VarDecl::isStaticDataMember().
Referenced by isInstantiationOf().
| static bool SubstQualifier | ( | Sema & | SemaRef, |
| const DeclT * | OldDecl, | ||
| DeclT * | NewDecl, | ||
| const MultiLevelTemplateArgumentList & | TemplateArgs | ||
| ) | [static] |
Definition at line 40 of file SemaTemplateInstantiateDecl.cpp.
References clang::Sema::SubstNestedNameSpecifierLoc().
Referenced by clang::Sema::InstantiateFunctionDefinition().