[CodeGen] Look at the type of a block capture field rather than the type
authorAkira Hatanaka <ahatanaka@apple.com>
Wed, 22 Aug 2018 13:41:19 +0000 (13:41 +0000)
committerAkira Hatanaka <ahatanaka@apple.com>
Wed, 22 Aug 2018 13:41:19 +0000 (13:41 +0000)
commit2a5e4639eaa6d85d882a60cd31d82110a8ef55d0
treeea389085a0b7fef879c14a01b0fec27a27ba152d
parent2ca72e03c3e690d618319c9563b5e28d10b9f857
[CodeGen] Look at the type of a block capture field rather than the type
of the captured variable when determining whether the capture needs
special handing when the block is copied or disposed.

This fixes bugs in the handling of variables captured by a block that is
nested inside a lambda that captures the variables by reference.

rdar://problem/43540889

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

llvm-svn: 340408
clang/lib/CodeGen/CGBlocks.cpp
clang/test/CodeGenObjCXX/block-nested-in-lambda.cpp [deleted file]
clang/test/CodeGenObjCXX/block-nested-in-lambda.mm [new file with mode: 0644]