diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2011-05-05 17:18:12 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2011-05-05 17:18:12 +0000 |
commit | ff365592d1878c0e454f288e30613664a72cff4c (patch) | |
tree | 9bceb83af4cf5ed5ab1eddbc08e42e97cb5c30eb /lib/Sema | |
parent | 31c79b470bf609028b585266a3127e7fb5f0a534 (diff) |
When instantiating a block expression, the instantiated
blockScopeInfo's CapturesCXXThis field need get set as
well. // rdar://9362021. John M. please review.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130930 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema')
-rw-r--r-- | lib/Sema/TreeTransform.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Sema/TreeTransform.h b/lib/Sema/TreeTransform.h index 2a71e14265..4bb1841716 100644 --- a/lib/Sema/TreeTransform.h +++ b/lib/Sema/TreeTransform.h @@ -7700,6 +7700,11 @@ TreeTransform<Derived>::TransformBlockExpr(BlockExpr *E) { BlockScopeInfo *blockScope = SemaRef.getCurBlock(); blockScope->TheDecl->setIsVariadic(oldBlock->isVariadic()); + // We built a new blockScopeInfo in call to ActOnBlockStart + // in above, CapturesCXXThis need be set here from the block + // expression. + blockScope->CapturesCXXThis = oldBlock->capturesCXXThis(); + llvm::SmallVector<ParmVarDecl*, 4> params; llvm::SmallVector<QualType, 4> paramTypes; @@ -7760,8 +7765,6 @@ TreeTransform<Derived>::TransformBlockExpr(BlockExpr *E) { // In builds with assertions, make sure that we captured everything we // captured before. - if (oldBlock->capturesCXXThis()) assert(blockScope->CapturesCXXThis); - for (BlockDecl::capture_iterator i = oldBlock->capture_begin(), e = oldBlock->capture_end(); i != e; ++i) { VarDecl *oldCapture = i->getVariable(); |