diff options
Diffstat (limited to 'test/Analysis/temporaries.mm')
-rw-r--r-- | test/Analysis/temporaries.mm | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/test/Analysis/temporaries.mm b/test/Analysis/temporaries.mm index 3b6166db6e303..43546ae3441d8 100644 --- a/test/Analysis/temporaries.mm +++ b/test/Analysis/temporaries.mm @@ -2,6 +2,8 @@ // expected-no-diagnostics +#define nil ((id)0) + // Stripped down unique_ptr<int> struct IntPtr { IntPtr(): i(new int) {} @@ -15,9 +17,13 @@ struct IntPtr { -(void) foo: (IntPtr)arg; @end -void bar(Foo *f) { +void testArgumentRegionInvalidation(Foo *f) { IntPtr ptr; int *i = ptr.i; [f foo: static_cast<IntPtr &&>(ptr)]; *i = 99; // no-warning } + +void testNilReceiverCleanup() { + [nil foo: IntPtr()]; +} |