diff options
| author | Fariborz Jahanian <fjahanian@apple.com> | 2013-11-15 22:18:17 +0000 |
|---|---|---|
| committer | Fariborz Jahanian <fjahanian@apple.com> | 2013-11-15 22:18:17 +0000 |
| commit | a649c82d69eee3e621b22500c7e6528e11037cc8 (patch) | |
| tree | 53b48c15a823eab86c1040194f59a1d585a5c6fe /clang/test/SemaObjC/objcbridge-attribute.m | |
| parent | fbd82d0813b32389ec194824b10ef12d864766f6 (diff) | |
| download | bcm5719-llvm-a649c82d69eee3e621b22500c7e6528e11037cc8.tar.gz bcm5719-llvm-a649c82d69eee3e621b22500c7e6528e11037cc8.zip | |
ObjectiveC ARC. Lookup type associated with objc_bridage at
the point of CF object type-cast and issue diagnostic
if it is not a valid ObjectiveC class. // rdar//15454846.
This is wip.
llvm-svn: 194861
Diffstat (limited to 'clang/test/SemaObjC/objcbridge-attribute.m')
| -rw-r--r-- | clang/test/SemaObjC/objcbridge-attribute.m | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/clang/test/SemaObjC/objcbridge-attribute.m b/clang/test/SemaObjC/objcbridge-attribute.m index 20e348c06ce..ddf379a38f7 100644 --- a/clang/test/SemaObjC/objcbridge-attribute.m +++ b/clang/test/SemaObjC/objcbridge-attribute.m @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s +// RUN: %clang_cc1 -fsyntax-only -fobjc-arc -verify -Wno-objc-root-class %s // rdar://15454846 typedef struct __CFErrorRef * __attribute__ ((objc_bridge(NSError))) CFErrorRef; @@ -27,3 +27,12 @@ typedef union __CFUColor * __attribute__((objc_bridge(NSUColor))) CFUColorRef; / } @end + +@protocol NSTesting @end +@class NSString; + +typedef struct __CFError * __attribute__((objc_bridge(NSTesting))) CFTestingRef; // expected-note {{declared here}} + +id foo(CFTestingRef cf) { + return (NSString *)cf; // expected-error {{CF object of type 'CFTestingRef' (aka 'struct __CFError *') with 'objc_bridge' attribute which has parameter that does not name an Objective-C class}} +} |

