diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2011-06-20 20:54:42 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2011-06-20 20:54:42 +0000 |
commit | 4ad56863995246e115c684a305d0f3d75e4faeeb (patch) | |
tree | 8af566fac27c6c352ac1a2a5dab146d50d85ae6c /clang/test | |
parent | 91016396b958602b61e7665b1c841769a0845869 (diff) | |
download | bcm5719-llvm-4ad56863995246e115c684a305d0f3d75e4faeeb.tar.gz bcm5719-llvm-4ad56863995246e115c684a305d0f3d75e4faeeb.zip |
objc-arc: allow explicit unbridged casts if the source of the cast is a
message sent to an objc method (or property access)
// rdar://9474349
llvm-svn: 133469
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/SemaObjC/arc-unbridged-cast.m | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/test/SemaObjC/arc-unbridged-cast.m b/clang/test/SemaObjC/arc-unbridged-cast.m new file mode 100644 index 00000000000..03c84cfce33 --- /dev/null +++ b/clang/test/SemaObjC/arc-unbridged-cast.m @@ -0,0 +1,18 @@ +// // RUN: %clang_cc1 -triple x86_64-apple-darwin11 -fobjc-nonfragile-abi -fsyntax-only -fobjc-arc -verify %s +// rdar://9744349 + +typedef const struct __CFString * CFStringRef; + +@interface I +@property CFStringRef P; +@end + +@implementation I +@synthesize P; +- (id) Meth { + I* p1 = (id)[p1 P]; + id p2 = (__bridge_transfer id)[p1 P]; + id p3 = (__bridge I*)[p1 P]; + return (id) p1.P; +} +@end |