[PATCH] D99262: [analyzer] Fix dead store checker false positive

Balázs Benics via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 24 12:26:37 PDT 2021


steakhal added a comment.

In D99262#2648533 <https://reviews.llvm.org/D99262#2648533>, @vsavchenko wrote:

> In D99262#2648512 <https://reviews.llvm.org/D99262#2648512>, @steakhal wrote:
>
>> I see your point.
>>
>> Would it report this issue?
>>
>>   int test() {
>>     struct Foo foo = {0, 0}; // I would expect a warning here, that 'foo' was initialized but never read.
>>     (void)foo;
>>    return 0;
>>   }
>>
>> Only nits besides this.
>
> We got one big fat complaint about that, and I can see the point.

We should at least document it as testcase.



================
Comment at: clang/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp:25
 #include "llvm/ADT/BitVector.h"
+#include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/SmallString.h"
----------------
vsavchenko wrote:
> steakhal wrote:
> > I don't see any new code that would depend on this header.
> `llvm::all_of`?
Oh sure!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99262/new/

https://reviews.llvm.org/D99262



More information about the cfe-commits mailing list