From: Ted Kremenek Date: Tue, 1 Feb 2011 20:45:26 +0000 (+0000) Subject: Add test case for dead stores checker to not flag dead assignments to 'self' within... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bf5c3acae3d6ed253048b1ec6a1e2a7ab5d65fad;p=clang Add test case for dead stores checker to not flag dead assignments to 'self' within a nested assignment. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124681 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Analysis/dead-stores.m b/test/Analysis/dead-stores.m index 730b8266bd..852e63afcd 100644 --- a/test/Analysis/dead-stores.m +++ b/test/Analysis/dead-stores.m @@ -59,3 +59,20 @@ void foo_rdar8527823(); } } @end + +// Don't flag dead stores to assignments to self within a nested assignment. +@interface Rdar7947686 +- (id) init; +@end + +@interface Rdar7947686_B : Rdar7947686 +- (id) init; +@end + +@implementation Rdar7947686_B +- (id) init { + id x = (self = [super init]); // no-warning + return x; +} +@end +