Fariborz Jahanian | 87c7791 | 2013-11-21 20:50:32 +0000 | [diff] [blame^] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s |
| 2 | // rdar://15498044 |
| 3 | |
| 4 | typedef struct __attribute__((objc_bridge_mutable(NSMutableDictionary))) __CFDictionary * CFMutableDictionaryRef; // expected-note {{declared here}} |
| 5 | |
| 6 | @interface NSDictionary |
| 7 | @end |
| 8 | |
| 9 | @interface NSMutableDictionary : NSDictionary |
| 10 | @end |
| 11 | |
| 12 | void Test(NSMutableDictionary *md, NSDictionary *nd, CFMutableDictionaryRef mcf) { |
| 13 | |
| 14 | (void) (CFMutableDictionaryRef)md; |
| 15 | (void) (CFMutableDictionaryRef)nd; // expected-warning {{'NSDictionary' cannot bridge to 'CFMutableDictionaryRef' (aka 'struct __CFDictionary *')}} |
| 16 | (void) (NSDictionary *)mcf; // expected-warning {{'CFMutableDictionaryRef' (aka 'struct __CFDictionary *') bridges to NSMutableDictionary, not 'NSDictionary'}} |
| 17 | (void) (NSMutableDictionary *)mcf; // ok; |
| 18 | } |
| 19 | |