diff options
| author | Douglas Gregor <dgregor@apple.com> | 2011-01-19 21:32:01 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2011-01-19 21:32:01 +0000 |
| commit | 476e3029ec4df254ce2b56579bf937c24e120faf (patch) | |
| tree | fff985e49f3e7b1575199850036663de380df0d3 /clang/lib/AST | |
| parent | 54bce44895424fa1fce1a5f70d9ec79f9ca70fa3 (diff) | |
| download | bcm5719-llvm-476e3029ec4df254ce2b56579bf937c24e120faf.tar.gz bcm5719-llvm-476e3029ec4df254ce2b56579bf937c24e120faf.zip | |
Implement basic support for the use of variadic templates and blocks
together. In particular:
- Handle the use of captured parameter pack names within blocks
(BlockDeclRefExpr understands parameter packs now)
- Handle the declaration and expansion of parameter packs within a block's
parameter list, e.g., ^(Args ...args) { ... })
- Handle instantiation of blocks where the return type was not
explicitly specified. (unrelated, but necessary for my tests).
Together, these fixes should make blocks and variadic templates work
reasonably well together. Note that BlockDeclRefExpr is still broken
w.r.t. its computation of type and value dependence, which will still
cause problems for blocks in templates.
llvm-svn: 123849
Diffstat (limited to 'clang/lib/AST')
| -rw-r--r-- | clang/lib/AST/Expr.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp index 4afed433a3c..9dc790256e7 100644 --- a/clang/lib/AST/Expr.cpp +++ b/clang/lib/AST/Expr.cpp @@ -2932,6 +2932,18 @@ Stmt::child_iterator ObjCMessageExpr::child_end() { } // Blocks +BlockDeclRefExpr::BlockDeclRefExpr(ValueDecl *d, QualType t, ExprValueKind VK, + SourceLocation l, bool ByRef, + bool constAdded, Stmt *copyConstructorVal) + : Expr(BlockDeclRefExprClass, t, VK, OK_Ordinary, + (!t.isNull() && t->isDependentType()), false, + d->isParameterPack()), + D(d), Loc(l), IsByRef(ByRef), + ConstQualAdded(constAdded), CopyConstructorVal(copyConstructorVal) +{ + // FIXME: Compute type/value dependence. +} + Stmt::child_iterator BlockExpr::child_begin() { return child_iterator(); } Stmt::child_iterator BlockExpr::child_end() { return child_iterator(); } |

