It is common for the ivars for read-only assign properties to always be stored retained,
so don't warn for a release in dealloc for the ivar backing these properties.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259998
91177308-0d34-0410-b5e6-
96231b3b80d8
<< "' was retained by a synthesized property "
"but was not released in 'dealloc'";
} else {
+ // It is common for the ivars for read-only assign properties to
+ // always be stored retained, so don't warn for a release in
+ // dealloc for the ivar backing these properties.
+ if (PD->isReadOnly())
+ continue;
+
name = LOpts.getGC() == LangOptions::NonGC
? "extra ivar release (use-after-release)"
: "extra ivar release (Hybrid MM, non-GC)";
@synthesize Z = _Z; // expected-warning{{The '_Z' instance variable in 'MyClass' was not retained by a synthesized property but was released in 'dealloc'}}
@synthesize K = _K;
@synthesize L = _L; // no-warning
-@synthesize N = _N; // expected-warning{{The '_N' instance variable in 'MyClass' was not retained by a synthesized property but was released in 'dealloc'}}
+@synthesize N = _N; // no-warning
@synthesize M = _M;
@synthesize V = _V;
@synthesize W = _W; // expected-warning{{The '_W' instance variable in 'MyClass' was retained by a synthesized property but was not released in 'dealloc'}}