summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclBase.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-01-05 21:11:38 +0000
committerDouglas Gregor <dgregor@apple.com>2011-01-05 21:11:38 +0000
commit3c6bd2ad386590ffcaa65e49a36e7976be82062d (patch)
tree6edef04ecbd5f4d81ce3e49d2981c41980763c4a /clang/lib/AST/DeclBase.cpp
parentf491ee2ea68585b7facadc03d4b7440e59e0bd81 (diff)
downloadbcm5719-llvm-3c6bd2ad386590ffcaa65e49a36e7976be82062d.tar.gz
bcm5719-llvm-3c6bd2ad386590ffcaa65e49a36e7976be82062d.zip
Add Decl::isParameterPack(), which covers both function and template
parameter packs, along with ParmVarDecl::isParameterPack(), which looks for function parameter packs. Use these routines to fix some obvious FIXMEs. llvm-svn: 122904
Diffstat (limited to 'clang/lib/AST/DeclBase.cpp')
-rw-r--r--clang/lib/AST/DeclBase.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp
index 700100507b4..e16bd22f336 100644
--- a/clang/lib/AST/DeclBase.cpp
+++ b/clang/lib/AST/DeclBase.cpp
@@ -119,6 +119,13 @@ bool Decl::isTemplateParameterPack() const {
return false;
}
+bool Decl::isParameterPack() const {
+ if (const ParmVarDecl *Parm = dyn_cast<ParmVarDecl>(this))
+ return Parm->isParameterPack();
+
+ return isTemplateParameterPack();
+}
+
bool Decl::isFunctionOrFunctionTemplate() const {
if (const UsingShadowDecl *UD = dyn_cast<UsingShadowDecl>(this))
return UD->getTargetDecl()->isFunctionOrFunctionTemplate();
OpenPOWER on IntegriCloud