Is it a known issue, or should I fill a bug report (or did I miss something) ?
Example:
clang --analyze leak.m
leak.m:5:19: warning: Potential leak of an object allocated on line 5 and stored into ‘str’
NSString *str = [[NSString alloc] initWithCString:“Hello leak” encoding:NSUTF8StringEncoding];
clang --analyze leak.m -DEXCEPTION
[nothing]
--------------------------- leak.m
#import <Foundation/Foundation.h>
int test() {
NSString *str = [[NSString alloc] initWithCString:“Hello leak” encoding:NSUTF8StringEncoding];
#ifdef EXCEPTION
@try {
#endif
NSLog(@“%@”, str);
#ifdef EXCEPTION
} @catch (NSException *exception) {
NSLog(@“%@”, exception);
}
#endif
return str != 0;
}