[cfe-commits] r59988 - in /cfe/trunk: lib/Sema/SemaDeclObjC.cpp test/SemaObjC/property-noprotocol-warning.m
Fariborz Jahanian
fjahanian at apple.com
Mon Nov 24 14:16:01 PST 2008
Author: fjahanian
Date: Mon Nov 24 16:16:00 2008
New Revision: 59988
URL: http://llvm.org/viewvc/llvm-project?rev=59988&view=rev
Log:
Patch to remove bogus waring when a property declaration
is imported from a protocol into the implementation.
Added:
cfe/trunk/test/SemaObjC/property-noprotocol-warning.m
Modified:
cfe/trunk/lib/Sema/SemaDeclObjC.cpp
Modified: cfe/trunk/lib/Sema/SemaDeclObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclObjC.cpp?rev=59988&r1=59987&r2=59988&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclObjC.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclObjC.cpp Mon Nov 24 16:16:00 2008
@@ -610,7 +610,7 @@
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);
}
Added: cfe/trunk/test/SemaObjC/property-noprotocol-warning.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/property-noprotocol-warning.m?rev=59988&view=auto
==============================================================================
--- cfe/trunk/test/SemaObjC/property-noprotocol-warning.m (added)
+++ cfe/trunk/test/SemaObjC/property-noprotocol-warning.m Mon Nov 24 16:16:00 2008
@@ -0,0 +1,36 @@
+// RUN: clang -fsyntax-only -verify %s
+
+
+ at interface Object
+- (id) new;
+ at end
+
+ at protocol GCObject
+ at property int class;
+ at end
+
+ at protocol DerivedGCObject <GCObject>
+ at property int Dclass;
+ at end
+
+ at interface GCObject : Object <DerivedGCObject> {
+ int ifield;
+ int iOwnClass;
+ int iDclass;
+}
+ at property int OwnClass;
+ at end
+
+ at implementation GCObject : Object
+ at synthesize class=ifield;
+ at synthesize Dclass=iDclass;
+ at synthesize OwnClass=iOwnClass;
+ at 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;
+}
More information about the cfe-commits
mailing list