Mercurial > hg > CbC > CbC_llvm
view clang/test/Analysis/retain-release-compound-literal.m @ 266:00f31e85ec16 default tip
Added tag current for changeset 31d058e83c98
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 14 Oct 2023 10:13:55 +0900 |
parents | c4bab56944e8 |
children |
line wrap: on
line source
// RUN: %clang_analyze_cc1 -verify -Wno-objc-root-class %s \ // RUN: -analyzer-checker=core,osx.cocoa.RetainCount #define NULL 0 #define CF_RETURNS_RETAINED __attribute__((cf_returns_retained)) #define CF_CONSUMED __attribute__((cf_consumed)) void clang_analyzer_eval(int); typedef const void *CFTypeRef; extern CFTypeRef CFCreate(void) CF_RETURNS_RETAINED; extern CFTypeRef CFRetain(CFTypeRef cf); extern void CFRelease(CFTypeRef cf); void bar(CFTypeRef *v) {} void test1(void) { CFTypeRef *values = (CFTypeRef[]){ CFCreate(), // no-warning CFCreate(), // expected-warning{{leak}} CFCreate()}; // no-warning CFRelease(values[0]); CFRelease(values[2]); }