From e57d88c6a376c4d2badec4cdee1ef74d6a40a60e Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Tue, 1 Feb 2011 20:45:26 +0000 Subject: [PATCH] Add test case for dead stores checker to not flag dead assignments to 'self' within a nested assignment. llvm-svn: 124681 --- clang/test/Analysis/dead-stores.m | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/clang/test/Analysis/dead-stores.m b/clang/test/Analysis/dead-stores.m index 730b8266bd10..852e63afcda9 100644 --- a/clang/test/Analysis/dead-stores.m +++ b/clang/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 +