summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2013-08-14 23:58:55 +0000
committerFariborz Jahanian <fjahanian@apple.com>2013-08-14 23:58:55 +0000
commit8181caa44ed14be2eaa8ddacb17e5264012020c0 (patch)
tree09a4459ecee532e29fbeaff570f2456eb2547ca3 /clang/test
parent9d8103de7ace78b609c3320244f38240c1299374 (diff)
downloadbcm5719-llvm-8181caa44ed14be2eaa8ddacb17e5264012020c0.tar.gz
bcm5719-llvm-8181caa44ed14be2eaa8ddacb17e5264012020c0.zip
ObjectiveC [Sema]. This patch makes sure that all inherited
properties (direct or indirect) setter/getter (or declared methods as well) are seen by the method implementation type matching logic before declaration of method in super class is seen. This fixes the warning coming out of that method mismatch. // rdar://14650159 llvm-svn: 188438
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/SemaObjC/method-conflict-2.m49
1 files changed, 49 insertions, 0 deletions
diff --git a/clang/test/SemaObjC/method-conflict-2.m b/clang/test/SemaObjC/method-conflict-2.m
index ec80a433cc7..47c3d6c2c23 100644
--- a/clang/test/SemaObjC/method-conflict-2.m
+++ b/clang/test/SemaObjC/method-conflict-2.m
@@ -64,3 +64,52 @@ typedef long long int64_t;
return 0;
}
@end
+
+// rdar://14650159
+// Tests that property inherited indirectly from a nested protocol
+// is seen by the method implementation type matching logic before
+// method in super class is seen. This fixes the warning coming
+// out of that method mismatch.
+@interface NSObject (NSDict)
+- (void)setValue:(id)value;
+- (id)value;
+@end
+
+@protocol ProtocolWithValue
+@property (nonatomic) unsigned value;
+@end
+
+@protocol InterveningProtocol <ProtocolWithValue>
+@end
+
+@interface UsesProtocolWithValue : NSObject <ProtocolWithValue>
+@end
+
+@implementation UsesProtocolWithValue
+@synthesize value=_value;
+- (unsigned) value
+{
+ return _value;
+}
+- (void) setValue:(unsigned)value
+{
+ _value = value;
+}
+@end
+
+
+@interface UsesInterveningProtocol : NSObject <InterveningProtocol>
+@end
+
+@implementation UsesInterveningProtocol
+
+@synthesize value=_value;
+- (unsigned) value
+{
+ return _value;
+}
+- (void) setValue:(unsigned)value
+{
+ _value = value;
+}
+@end
OpenPOWER on IntegriCloud