diff options
Diffstat (limited to 'clang/test/SemaObjC')
| -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; +} + |

