The __block Objective-C pointers can be set but not used due to a commonly used lifetime extension pattern in Objective-C.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
This seems reasonable to me, but I don't know Objective C. Presumably someone who does should accept.
Comment Actions
The lifetime of an object won't be extended in the following case since the variable isn't captured by a block:
void foo(id);
void test(id a) {
__block id t = a;
foo(a);
t = 0;
}clang should probably warn if a variable marked __block isn't captured by a block, but I don't think -Wunused-but-set-variable should catch that.