]> granicus.if.org Git - clang/commit
[Sema] Add variable captured by a block to the enclosing lambda's
authorAkira Hatanaka <ahatanaka@apple.com>
Wed, 1 Mar 2017 06:11:25 +0000 (06:11 +0000)
committerAkira Hatanaka <ahatanaka@apple.com>
Wed, 1 Mar 2017 06:11:25 +0000 (06:11 +0000)
commit99d7e9960aff8eb0ce140aaef81a060883187a96
tree3e7fef204e6d32e02f7495ef7503affb59b1458b
parent374e14be61ad4c105188d07e4e1320fb0bec4e34
[Sema] Add variable captured by a block to the enclosing lambda's
potential capture list.

Fix Sema::getCurLambda() to return the innermost lambda scope when there
is a block enclosed in the lambda. Previously, the method would return a
nullptr in such cases, which would prevent a variable captured by the
enclosed block to be added to the lambda scope's potential capture list.

rdar://problem/28412462

Differential Revision: https://reviews.llvm.org/D25556

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@296584 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Sema/Sema.h
lib/Sema/Sema.cpp
lib/Sema/SemaExpr.cpp
test/SemaObjCXX/blocks.mm