It explains why we can't just synthesize bodies of setters in BodyFarm.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261248
91177308-0d34-0410-b5e6-
96231b3b80d8
return nullptr;
// For now, we only synthesize getters.
+ // Synthesizing setters would cause false negatives in the
+ // RetainCountChecker because the method body would bind the parameter
+ // to an instance variable, causing it to escape. This would prevent
+ // warning in the following common scenario:
+ //
+ // id foo = [[NSObject alloc] init];
+ // self.foo = foo; // We should warn that foo leaks here.
+ //
if (D->param_size() != 0)
return nullptr;