diff options
-rw-r--r-- | lib/Sema/SemaDeclObjC.cpp | 2 | ||||
-rw-r--r-- | test/SemaObjC/property-noprotocol-warning.m | 36 |
2 files changed, 37 insertions, 1 deletions
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index 4d4c82be69..95737af18a 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -610,7 +610,7 @@ void Sema::CheckProtocolMethodDefs(SourceLocation ImpLoc, E = PDecl->instmeth_end(); I != E; ++I) { ObjCMethodDecl *method = *I; if (method->getImplementationControl() != ObjCMethodDecl::Optional && - !InsMap.count(method->getSelector()) && + !method->isSynthesized() && !InsMap.count(method->getSelector()) && (!Super || !Super->lookupInstanceMethod(method->getSelector()))) WarnUndefinedMethod(ImpLoc, method, IncompleteImpl); } diff --git a/test/SemaObjC/property-noprotocol-warning.m b/test/SemaObjC/property-noprotocol-warning.m new file mode 100644 index 0000000000..021c7874a9 --- /dev/null +++ b/test/SemaObjC/property-noprotocol-warning.m @@ -0,0 +1,36 @@ +// RUN: clang -fsyntax-only -verify %s + + +@interface Object +- (id) new; +@end + +@protocol GCObject +@property int class; +@end + +@protocol DerivedGCObject <GCObject> +@property int Dclass; +@end + +@interface GCObject : Object <DerivedGCObject> { + int ifield; + int iOwnClass; + int iDclass; +} +@property int OwnClass; +@end + +@implementation GCObject : Object +@synthesize class=ifield; +@synthesize Dclass=iDclass; +@synthesize OwnClass=iOwnClass; +@end + +int main(int argc, char **argv) { + GCObject *f = [GCObject new]; + f.class = 5; + f.Dclass = 1; + f.OwnClass = 3; + return f.class + f.Dclass + f.OwnClass - 9; +} |