blob: 46ef02400e8cb2f773263053472dc008138d1b80 [file] [log] [blame]
Argyrios Kyrtzidise665d692011-06-18 00:53:41 +00001// RUN: %clang_cc1 -arcmt-check -verify -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi %s
John McCall8f0e8d22011-06-15 23:25:17 +00002
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}