aboutsummaryrefslogtreecommitdiffstats
path: root/include/clang/AST/DeclTemplate.h
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2016-11-25 19:07:40 +0000
committerDimitry Andric <dim@FreeBSD.org>2016-11-25 19:07:40 +0000
commit17c7957f023f02fc2c88f51f8908c19b52609275 (patch)
treec654618ff2d38e26916b49614d89fe01f4a4818d /include/clang/AST/DeclTemplate.h
parentc477790a57f44875b9de2043f2eb47dff2d20133 (diff)
downloadsrc-17c7957f023f02fc2c88f51f8908c19b52609275.tar.gz
src-17c7957f023f02fc2c88f51f8908c19b52609275.zip
Vendor import of clang release_39 branch r287912:vendor/clang/clang-release_39-r287912
Notes
Notes: svn path=/vendor/clang/dist/; revision=309154 svn path=/vendor/clang/clang-release_39-r287912/; revision=309155; tag=vendor/clang/clang-release_39-r287912
Diffstat (limited to 'include/clang/AST/DeclTemplate.h')
-rw-r--r--include/clang/AST/DeclTemplate.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/clang/AST/DeclTemplate.h b/include/clang/AST/DeclTemplate.h
index 4ac8cdc9beeb..d553e739c388 100644
--- a/include/clang/AST/DeclTemplate.h
+++ b/include/clang/AST/DeclTemplate.h
@@ -44,6 +44,8 @@ class VarTemplatePartialSpecializationDecl;
typedef llvm::PointerUnion3<TemplateTypeParmDecl*, NonTypeTemplateParmDecl*,
TemplateTemplateParmDecl*> TemplateParameter;
+NamedDecl *getAsNamedDecl(TemplateParameter P);
+
/// \brief Stores a list of template parameters for a TemplateDecl and its
/// derived classes.
class TemplateParameterList final
@@ -2912,6 +2914,14 @@ public:
friend class ASTDeclWriter;
};
+inline NamedDecl *getAsNamedDecl(TemplateParameter P) {
+ if (auto *PD = P.dyn_cast<TemplateTypeParmDecl*>())
+ return PD;
+ if (auto *PD = P.dyn_cast<NonTypeTemplateParmDecl*>())
+ return PD;
+ return P.get<TemplateTemplateParmDecl*>();
+}
+
} /* end of namespace clang */
#endif