summaryrefslogtreecommitdiffstats
path: root/test/SemaObjC/nsobject-attribute.m
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaObjC/nsobject-attribute.m')
-rw-r--r--test/SemaObjC/nsobject-attribute.m18
1 files changed, 15 insertions, 3 deletions
diff --git a/test/SemaObjC/nsobject-attribute.m b/test/SemaObjC/nsobject-attribute.m
index 13a4929..f41df89 100644
--- a/test/SemaObjC/nsobject-attribute.m
+++ b/test/SemaObjC/nsobject-attribute.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
typedef struct CGColor * __attribute__ ((NSObject)) CGColorRef;
static int count;
@@ -15,8 +15,8 @@ typedef void * __attribute__ ((NSObject)) CGColorRef2; // expected-error {{__at
@property(copy) CGColorRef x;
// rdar: // 7809460
-typedef struct CGColor *CGColorRefNoNSObject;
-@property (nonatomic, retain) __attribute__((NSObject)) CGColorRefNoNSObject color;
+typedef struct CGColor * __attribute__((NSObject)) CGColorRefNoNSObject;
+@property (nonatomic, retain) CGColorRefNoNSObject color;
@end
void setProperty(id self, id value) {
@@ -40,3 +40,15 @@ int main(int argc, char *argv[]) {
return 0;
}
+// rdar://10453342
+@interface I
+{
+ __attribute__((NSObject)) void * color; // expected-warning {{__attribute ((NSObject)) may be put on a typedef only, attribute is ignored}}
+}
+ // <rdar://problem/10930507>
+@property (nonatomic, retain) __attribute__((NSObject)) void * color; // // no-warning
+@end
+void test_10453342() {
+ char* __attribute__((NSObject)) string2 = 0; // expected-warning {{__attribute ((NSObject)) may be put on a typedef only, attribute is ignored}}
+}
+
OpenPOWER on IntegriCloud