aaron.ballman added a comment.

In D157879#4604233 <https://reviews.llvm.org/D157879#4604233>, @aeubanks wrote:

> ah I thought this was in `-Wall` but it's not
>
> the struct is
>
>   struct Foo {
>     const void* buffer;
>     uint32_t capacity;
>     uint32_t reserved;
>   };
>
> where `reserved` isn't explicitly initialized. that seems like reasonable 
> code, but I suppose we can just explicitly initialize `reserved` here

Thank you for sharing the use case, that's actually a rather interesting one! 
Leaving the identifier `reserved` off the field would trigger a 
`-Wmissing-declarations` diagnostic (which is on by default). You can leave the 
field named and use an in-class initializer for it and that should silence the 
diagnostic. But I kind of wonder if we want to special case fields named 
`reserved` or similar (`wReserved`, `reserved2`, etc)?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157879

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to