diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-12-23 23:51:58 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-12-23 23:51:58 +0000 |
commit | 10738d36b150aa65206890c1c845cdba076e4200 (patch) | |
tree | 9485127dbdbb9dd5937d9615b97baa9bb3ad3ab4 /lib/AST/Expr.cpp | |
parent | 662a4822ee7c8696434b054303c5076a606ab175 (diff) |
Add an AST representation for non-type template parameter
packs, e.g.,
template<typename T, unsigned ...Dims> struct multi_array;
along with semantic analysis support for finding unexpanded non-type
template parameter packs in types, expressions, and so on.
Template instantiation involving non-type template parameter packs
probably doesn't work yet. That'll come soon.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122527 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Expr.cpp')
-rw-r--r-- | lib/AST/Expr.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index 5d0e0e3093..d8bb0af018 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -208,8 +208,14 @@ void DeclRefExpr::computeDependence() { // member of an unknown specialization. // (handled by DependentScopeDeclRefExpr) - // FIXME: Variadic templates require that we compute whether this - // declaration reference contains an unexpanded parameter pack. + // 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. } DeclRefExpr::DeclRefExpr(NestedNameSpecifier *Qualifier, |