aboutsummaryrefslogtreecommitdiff
path: root/lib/AST
diff options
context:
space:
mode:
Diffstat (limited to 'lib/AST')
-rw-r--r--lib/AST/Decl.cpp4
-rw-r--r--lib/AST/DeclBase.cpp7
-rw-r--r--lib/AST/Expr.cpp7
3 files changed, 13 insertions, 5 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp
index 5b82ddd7c6..c51d2cdc37 100644
--- a/lib/AST/Decl.cpp
+++ b/lib/AST/Decl.cpp
@@ -1221,6 +1221,10 @@ SourceRange ParmVarDecl::getDefaultArgRange() const {
return SourceRange();
}
+bool ParmVarDecl::isParameterPack() const {
+ return isa<PackExpansionType>(getType());
+}
+
//===----------------------------------------------------------------------===//
// FunctionDecl Implementation
//===----------------------------------------------------------------------===//
diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp
index 700100507b..e16bd22f33 100644
--- a/lib/AST/DeclBase.cpp
+++ b/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();
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp
index 3a71883419..c1dc5326e5 100644
--- a/lib/AST/Expr.cpp
+++ b/lib/AST/Expr.cpp
@@ -211,11 +211,8 @@ void DeclRefExpr::computeDependence() {
// Determine whether this expression contains any unexpanded parameter
// packs.
// Is the declaration a parameter pack?
- if (NonTypeTemplateParmDecl *NTTP = dyn_cast<NonTypeTemplateParmDecl>(D)) {
- if (NTTP->isParameterPack())
- ExprBits.ContainsUnexpandedParameterPack = true;
- }
- // FIXME: Variadic templates function parameter packs.
+ if (D->isParameterPack())
+ ExprBits.ContainsUnexpandedParameterPack = true;
}
DeclRefExpr::DeclRefExpr(NestedNameSpecifier *Qualifier,