[PATCH] D76229: [clang-tidy] Added PlacementNewStorageCheck

Karasev Nikita via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 17 00:08:47 PDT 2020


f00kat added a comment.

In D76229#1925948 <https://reviews.llvm.org/D76229#1925948>, @lebedev.ri wrote:

> In D76229#1925371 <https://reviews.llvm.org/D76229#1925371>, @f00kat wrote:
>
> > In D76229#1925360 <https://reviews.llvm.org/D76229#1925360>, @lebedev.ri wrote:
> >
> > > This seems to be already handled by clang static analyzer? (`clang-analyzer-cplusplus.PlacementNew`)
> > >
> > >   <source>:19:5: warning: Storage provided to placement new is only 2 bytes, whereas the allocated type requires 8 bytes [clang-analyzer-cplusplus.PlacementNew]
> > >       ::new (&s1) long;
> > >       ^
> > >   <source>:19:5: note: Storage provided to placement new is only 2 bytes, whereas the allocated type requires 8 bytes
> > >   <source>:64:3: warning: Storage provided to placement new is only 2 bytes, whereas the allocated type requires 8 bytes [clang-analyzer-cplusplus.PlacementNew]
> > >     ::new (buffer3) long;
> > >     ^
> > >
> > >
> > > https://godbolt.org/z/9VX5WW
> >
> >
> > But it seems like not all of my tests pass on static analyzer?
>
>
> I have not really worked with static analyzer code, but assuming that those cases
>  that are no longer diagnosed as compared to this clang-tidy checks *should* be diagnosed
>  (i.e. diagnosing them isn't false-positive), then i'd think that static analyzer check
>  simply needs some work?


Yeah. You are right. I will try to improve exist checker.
What we gonna do with this patch? Remove it?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76229





More information about the cfe-commits mailing list