// initialization based on their name.
if (M->getMethodFamily() == OMF_init ||
M->getMethodFamily() == OMF_dealloc ||
+ M->getMethodFamily() == OMF_copy ||
+ M->getMethodFamily() == OMF_mutableCopy ||
M->getSelector().getNameForSlot(0).find("init") != StringRef::npos ||
M->getSelector().getNameForSlot(0).find("Init") != StringRef::npos)
continue;
-// RUN: %clang_cc1 -analyze -analyzer-checker=alpha.osx.cocoa.DirectIvarAssignment -fobjc-default-synthesize-properties -Wno-objc-root-class -verify -fblocks %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=alpha.osx.cocoa.DirectIvarAssignment -fobjc-default-synthesize-properties -verify -fblocks %s
+
+typedef signed char BOOL;
+@protocol NSObject - (BOOL)isEqual:(id)object; @end
+@interface NSObject <NSObject> {}
++(id)alloc;
+-(id)init;
+-(id)autorelease;
+-(id)copy;
+-(id)retain;
+@end
@interface MyClass;
@end
-@interface TestProperty {
+@interface TestProperty :NSObject {
MyClass *_Z;
id _nonSynth;
}
return self;
}
+ - (id) copyWithPtrY: (TestProperty*) value {
+ TestProperty *another = [[TestProperty alloc] init];
+ another->_Y = value->_Y; // no-warning
+ return another;
+ }
+
- (id) myInitWithPtr: (MyClass*) value {
_Y = value; // no-warning
return self;