diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-01-05 21:11:38 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-01-05 21:11:38 +0000 |
commit | 3c6bd2ad386590ffcaa65e49a36e7976be82062d (patch) | |
tree | 6edef04ecbd5f4d81ce3e49d2981c41980763c4a /clang/lib/AST/DeclBase.cpp | |
parent | f491ee2ea68585b7facadc03d4b7440e59e0bd81 (diff) | |
download | bcm5719-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.cpp | 7 |
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(); |