| // RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s |
| typedef struct CGColor * __attribute__ ((NSObject)) CGColorRef; |
| static CGColorRef tmp = 0; |
| typedef struct S1 __attribute__ ((NSObject)) CGColorRef1; // expected-error {{__attribute ((NSObject)) is for pointer types only}} |
| typedef void * __attribute__ ((NSObject)) CGColorRef2; // expected-error {{__attribute ((NSObject)) is for pointer types only}} |
| @property(copy) CGColorRef x; |
| typedef struct CGColor * __attribute__((NSObject)) CGColorRefNoNSObject; |
| @property (nonatomic, retain) CGColorRefNoNSObject color; |
| void setProperty(id self, id value) { |
| ((HandTested *)self)->x = value; |
| id getProperty(id self) { |
| return (id)((HandTested *)self)->x; |
| @implementation HandTested |
| int main(int argc, char *argv[]) { |
| __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 |
| char* __attribute__((NSObject)) string2 = 0; // expected-warning {{__attribute ((NSObject)) may be put on a typedef only, attribute is ignored}} |