summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaObjC/property-inherited.m
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2014-02-15 00:04:36 +0000
committerFariborz Jahanian <fjahanian@apple.com>2014-02-15 00:04:36 +0000
commit92e3aa2622157eef651172996a7c6474bc5ec410 (patch)
treeb8f771f44bb64137d4c3084184c60b5f316b259d /clang/test/SemaObjC/property-inherited.m
parent60e6386b876c6cffc7dcf1db173cb9feeca9cded (diff)
downloadbcm5719-llvm-92e3aa2622157eef651172996a7c6474bc5ec410.tar.gz
bcm5719-llvm-92e3aa2622157eef651172996a7c6474bc5ec410.zip
[Objective-C Sema]. Warn when an indirectly overridden property
mismatches the one declared in current class; in addition to those that are directly overridden. // rdar://15967517 llvm-svn: 201446
Diffstat (limited to 'clang/test/SemaObjC/property-inherited.m')
-rw-r--r--clang/test/SemaObjC/property-inherited.m26
1 files changed, 26 insertions, 0 deletions
diff --git a/clang/test/SemaObjC/property-inherited.m b/clang/test/SemaObjC/property-inherited.m
index f5f1b420c22..cd223ddd1ff 100644
--- a/clang/test/SemaObjC/property-inherited.m
+++ b/clang/test/SemaObjC/property-inherited.m
@@ -44,3 +44,29 @@
@property(assign) Data *p_base;
@property(assign) NSData *p_data; // expected-warning{{property type 'NSData *' is incompatible with type 'NSMutableData *' inherited from 'Base'}}
@end
+
+// rdar://15967517
+@protocol P1
+@property (nonatomic) void* selected;
+@end
+
+@protocol P2
+@property (nonatomic) void* selected; // expected-note {{property declared here}}
+@end
+
+@interface MKAnnotationView <P1>
+@property (nonatomic) void* selected; // expected-note {{property declared here}}
+@property (nonatomic) char selected2;
+@end
+
+@interface Parent : MKAnnotationView <P2>
+@property (nonatomic) void* selected1; // expected-note {{property declared here}}
+@property (nonatomic) char selected2;
+@end
+
+@interface Child : Parent
+@property (nonatomic) char selected; // expected-warning {{property type 'char' is incompatible with type 'void *' inherited from 'MKAnnotationView'}} \
+ // expected-warning {{property type 'char' is incompatible with type 'void *' inherited from 'P2'}}
+@property (nonatomic) char selected1; // expected-warning {{property type 'char' is incompatible with type 'void *' inherited from 'Parent'}}
+@property (nonatomic) char selected2;
+@end
OpenPOWER on IntegriCloud