This reverts commit d50d9946d1d7e5f20881f0bc71fbd025040b1c96. Broke check-clang, see comments on https://reviews.llvm.org/D126067 Also revert dependent change "[analyzer] Deprecate the unused 'analyzer-opt-analyze-nested-blocks' cc1 flag" This reverts commit 07b4a6d0461fe64e10d30029ed3d598e49ca3810. Also revert "[analyzer] Fix buildbots after introducing a new frontend warning" This reverts commit 90374df15ddc58d823ca42326a76f58e748f20eb. (See https://reviews.llvm.org/rG90374df15ddc58d823ca42326a76f58e748f20eb)
19 lines
621 B
C
19 lines
621 B
C
// RUN: %clang_analyze_cc1 -analyzer-checker=core,osx.cocoa.RetainCount -analyzer-store=region -verify %s
|
|
|
|
typedef struct CGColorSpace *CGColorSpaceRef;
|
|
extern CGColorSpaceRef CGColorSpaceCreateDeviceRGB(void);
|
|
extern CGColorSpaceRef CGColorSpaceRetain(CGColorSpaceRef space);
|
|
extern void CGColorSpaceRelease(CGColorSpaceRef space);
|
|
|
|
void f(void) {
|
|
CGColorSpaceRef X = CGColorSpaceCreateDeviceRGB(); // expected-warning{{leak}}
|
|
CGColorSpaceRetain(X);
|
|
}
|
|
|
|
void fb(void) {
|
|
CGColorSpaceRef X = CGColorSpaceCreateDeviceRGB();
|
|
CGColorSpaceRetain(X);
|
|
CGColorSpaceRelease(X);
|
|
CGColorSpaceRelease(X); // no-warning
|
|
}
|