[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / Analysis / test-separate-retaincount.cpp
blob5ca4907e7291c1cb3ffcac58f9094028596a1d5c
1 // RUN: %clang_analyze_cc1 -std=c++14 -verify=no-retain-count %s \
2 // RUN: -analyzer-checker=core,osx \
3 // RUN: -analyzer-disable-checker osx.cocoa.RetainCount
4 //
5 // RUN: %clang_analyze_cc1 -std=c++14 -verify=no-os-object %s \
6 // RUN: -analyzer-checker=core,osx \
7 // RUN: -analyzer-disable-checker osx.OSObjectRetainCount
9 #include "os_object_base.h"
11 typedef const void * CFTypeRef;
12 extern CFTypeRef CFRetain(CFTypeRef cf);
13 extern void CFRelease(CFTypeRef cf);
15 #define CF_RETURNS_RETAINED __attribute__((cf_returns_retained))
16 extern CFTypeRef CFCreate() CF_RETURNS_RETAINED;
18 using size_t = decltype(sizeof(int));
20 void cf_overrelease() {
21 CFTypeRef cf = CFCreate();
22 CFRelease(cf);
23 CFRelease(cf); // no-os-object-warning{{Reference-counted object is used after it is released}}
26 void osobject_overrelease() {
27 OSObject *o = new OSObject;
28 o->release();
29 o->release(); // no-retain-count-warning{{Reference-counted object is used after it is released}}