2008-10-23 07:56:21 +08:00
|
|
|
// RUN: clang -checker-cfref -verify %s
|
2008-10-23 09:57:31 +08:00
|
|
|
// XFAIL
|
2008-10-23 07:56:21 +08:00
|
|
|
|
|
|
|
typedef const struct __CFString * CFStringRef;
|
|
|
|
typedef const struct __CFAllocator * CFAllocatorRef;
|
|
|
|
typedef const struct __CFURL * CFURLRef;
|
|
|
|
extern CFURLRef CFURLCreateWithString(CFAllocatorRef allocator, CFStringRef URLString, CFURLRef baseURL);
|
|
|
|
typedef signed char BOOL;
|
|
|
|
@protocol NSObject - (BOOL)isEqual:(id)object; @end
|
|
|
|
@interface NSObject <NSObject> {} @end
|
|
|
|
@class NSArray, NSString, NSURL;
|
|
|
|
|
|
|
|
@interface MyClass : NSObject
|
|
|
|
{
|
|
|
|
}
|
|
|
|
- (NSURL *)myMethod:(NSString *)inString;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation MyClass
|
|
|
|
|
|
|
|
- (NSURL *)myMethod:(NSString *)inString
|
|
|
|
{
|
2008-10-23 09:57:31 +08:00
|
|
|
NSURL *url = (NSURL *)CFURLCreateWithString(0, (CFStringRef)inString, 0);
|
|
|
|
return url; // expected-warning{{leak}}
|
2008-10-23 07:56:21 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
@end
|