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 | da3cc0d3bf22d8dd92df063c38ff788c713b78df (patch) | |
tree | f023677331cafb43b4bd87629648ec3bee5f1f8e /clang/lib/AST/Expr.cpp | |
parent | d71ffbcb2477dbd52aa5702c3ca994e720a1d360 (diff) | |
download | bcm5719-llvm-da3cc0d3bf22d8dd92df063c38ff788c713b78df.tar.gz bcm5719-llvm-da3cc0d3bf22d8dd92df063c38ff788c713b78df.zip |
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.
llvm-svn: 122527
Diffstat (limited to 'clang/lib/AST/Expr.cpp')
-rw-r--r-- | clang/lib/AST/Expr.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp index 5d0e0e30933..d8bb0af0183 100644 --- a/clang/lib/AST/Expr.cpp +++ b/clang/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, |