Home | History | Annotate | Download | only in SemaObjC
      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 
     10 typedef const struct CF_BRIDGED_TYPE(NSURL) __CFURL * CFURLRef;
     11 typedef signed long long CFIndex;
     12 typedef unsigned char           Boolean;
     13 typedef unsigned char                   UInt8;
     14 typedef const struct __CFAllocator * CFAllocatorRef;
     15 const CFAllocatorRef kCFAllocatorDefault;
     16 
     17 CF_IMPLICIT_BRIDGING_ENABLED
     18 CFURLRef CFURLCreateFromFileSystemRepresentation(CFAllocatorRef allocator, const UInt8 *buffer, CFIndex bufLen, Boolean isDirectory); // expected-note {{passing argument to parameter 'buffer' here}}
     19 CF_IMPLICIT_BRIDGING_DISABLED
     20 
     21 void 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