1 // RUN: %clang_analyze_cc1 -std=c++14 -analyzer-checker core,cplusplus -verify %s
3 // expected-no-diagnostics
7 // Stripped down unique_ptr<int>
9 IntPtr(): i(new int) {}
10 IntPtr(IntPtr &&o): i(o.i) { o.i = nullptr; }
11 ~IntPtr() { delete i; }
17 -(void) foo: (IntPtr)arg;
20 void testArgumentRegionInvalidation(Foo *f) {
23 [f foo: static_cast<IntPtr &&>(ptr)];
24 *i = 99; // no-warning
27 void testNilReceiverCleanup() {