[clang] 'unused-but-set-variable' warning should not apply to __block objective-c...
authorAlex Lorenz <arphaman@gmail.com>
Fri, 5 Nov 2021 05:01:33 +0000 (22:01 -0700)
committerAlex Lorenz <arphaman@gmail.com>
Fri, 5 Nov 2021 14:48:07 +0000 (07:48 -0700)
commita00944ebeab1b0adbce606cde4d2410fcbb3f440
tree5f9c2c33af2a37e756dc4ce1363bd62d6923c1c4
parent565cbc2ca2a0d687eb0e21b187f5277a33c833b3
[clang] 'unused-but-set-variable' warning should not apply to __block objective-c pointers

The __block Objective-C pointers can be set but not used due to a commonly used lifetime extension pattern in Objective-C.

Differential Revision: https://reviews.llvm.org/D112850
clang/lib/Sema/SemaDecl.cpp
clang/test/SemaObjC/block-capture-unused-variable.m [new file with mode: 0644]