• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: %clang_cc1  -fobjc-arc -verify %s
2// rdar://18222007
3
4#if __has_feature(arc_cf_code_audited)
5#define CF_IMPLICIT_BRIDGING_ENABLED _Pragma("clang arc_cf_code_audited begin")
6#define CF_IMPLICIT_BRIDGING_DISABLED _Pragma("clang arc_cf_code_audited end")
7#endif
8#define CF_BRIDGED_TYPE(T)              __attribute__((objc_bridge(T)))
9
10typedef const struct CF_BRIDGED_TYPE(NSURL) __CFURL * CFURLRef;
11typedef signed long long CFIndex;
12typedef unsigned char           Boolean;
13typedef unsigned char                   UInt8;
14typedef const struct __CFAllocator * CFAllocatorRef;
15const CFAllocatorRef kCFAllocatorDefault;
16
17CF_IMPLICIT_BRIDGING_ENABLED
18CFURLRef CFURLCreateFromFileSystemRepresentation(CFAllocatorRef allocator, const UInt8 *buffer, CFIndex bufLen, Boolean isDirectory); // expected-note {{passing argument to parameter 'buffer' here}}
19CF_IMPLICIT_BRIDGING_DISABLED
20
21void saveImageToJPG(const char *filename)
22{
23    CFURLRef url = CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault, filename, 10, 0); // expected-warning {{passing 'const char *' to parameter of type 'const UInt8 *' (aka 'const unsigned char *') converts between pointers to integer types with different sign}}
24}
25