blob: dba5227fae9f720f327b361832566b066e06255d [file] [log] [blame]
John McCall8f0e8d22011-06-15 23:25:17 +00001// RUN: arcmt-test -check-only -verify --args %s
2
3typedef int BOOL;
4typedef const struct __CFString * CFStringRef;
5
6@class NSString;
7
8void f(BOOL b) {
9 CFStringRef cfstr;
10 NSString *str = (NSString *)cfstr; // expected-error {{cast of C pointer type 'CFStringRef' (aka 'const struct __CFString *') to Objective-C pointer type 'NSString *' requires a bridged cast}} \
11 // expected-note{{use __bridge to convert directly (no change in ownership)}} \
12 // expected-note{{use __bridge_transfer to transfer ownership of a +1 'CFStringRef' (aka 'const struct __CFString *') into ARC}}
13 void *vp = str; // expected-error {{disallowed}}
14}