diff options
| author | Fariborz Jahanian <fjahanian@apple.com> | 2014-06-11 16:52:44 +0000 |
|---|---|---|
| committer | Fariborz Jahanian <fjahanian@apple.com> | 2014-06-11 16:52:44 +0000 |
| commit | 5cbbb1be9274d2c41cc8198424536cffd15d4d05 (patch) | |
| tree | 6a75f2079919ed8e84ab8597efb66ceab1692404 /clang/test | |
| parent | 5aa8fa250df9ff1e9e579836093a9dd09887f6a3 (diff) | |
| download | bcm5719-llvm-5cbbb1be9274d2c41cc8198424536cffd15d4d05.tar.gz bcm5719-llvm-5cbbb1be9274d2c41cc8198424536cffd15d4d05.zip | |
Objective-C. Patch to handle bridge attribute warnings
correctly when both NSAttributedString and
NSMutableAttributedString are specified on the same
CFStruct via different typedefs. // rdar://17238954
llvm-svn: 210660
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/SemaObjC/objc-mixed-bridge-attribute.m | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/clang/test/SemaObjC/objc-mixed-bridge-attribute.m b/clang/test/SemaObjC/objc-mixed-bridge-attribute.m new file mode 100644 index 00000000000..5fa34731967 --- /dev/null +++ b/clang/test/SemaObjC/objc-mixed-bridge-attribute.m @@ -0,0 +1,26 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s +// expected-no-diagnostics +// rdar://17238954 + +typedef const struct __attribute__((objc_bridge(NSAttributedString))) __CFAttributedString *CFAttributedStringRef; + +typedef struct __attribute__((objc_bridge_mutable(NSMutableAttributedString))) __CFAttributedString *CFMutableAttributedStringRef; + +@interface NSAttributedString +@end + +@interface NSMutableAttributedString +@end + +struct __CFAttributedString { +}; + +void Test1(CFAttributedStringRef attrStr) +{ + id x = (NSAttributedString *) attrStr; // no warning +} + +void Test2(NSAttributedString *attrStr) { + CFAttributedStringRef cfsr = (CFAttributedStringRef) attrStr; +} + |

