bool isVariadic() const { return IsVariadic; }
bool isSynthesized() const { return IsSynthesized; }
+ void setIsSynthesized() { IsSynthesized = true; }
// Related to protocols declared in @protocol
void setDeclImplementation(ImplementationControl ic) {
insMethods.push_back(GetterDecl);
InsMap[property->getGetterName()] = GetterDecl;
}
+ else
+ // A user declared getter will be synthesize when @synthesize of
+ // the property with the same name is seen in the @implementation
+ GetterDecl->setIsSynthesized();
property->setGetterMethodDecl(GetterDecl);
// Skip setter if property is read-only.
0, 0);
SetterDecl->setMethodParams(&Argument, 1);
}
+ else
+ // A user declared setter will be synthesize when @synthesize of
+ // the property with the same name is seen in the @implementation
+ SetterDecl->setIsSynthesized();
property->setSetterMethodDecl(SetterDecl);
}
--- /dev/null
+// RUN: clang -fsyntax-only -Werror -verify %s
+
+@interface MyClass {
+ const char *_myName;
+}
+
+@property const char *myName;
+
+- (const char *)myName;
+- (void)setMyName:(const char *)name;
+
+@end
+
+@implementation MyClass
+
+@synthesize myName = _myName;
+
+@end