1 // RUN: %clang_analyze_cc1 -analyzer-checker=core,osx -analyzer-output=text -verify %s
3 // expected-no-diagnostics
5 typedef void *CFTypeRef
;
6 typedef struct _CFURLCacheRef
*CFURLCacheRef
;
8 CFTypeRef
CustomCFRetain(CFTypeRef
);
9 void invalidate(void *);
12 CFTypeRef
returnFieldAtPlus0() {
23 CustomCFRetain(s1
->returnFieldAtPlus0());
25 // Definitely no leak end-of-path note here. The retained pointer
26 // is still accessible through s1 and s2.
27 ((void) 0); // no-warning
29 // FIXME: Ideally we need to warn after this invalidate(). The per-function
30 // retain-release contract is violated: the programmer should release
31 // the symbol after it was retained, within the same function.