[PATCH] D157879: [clang] Report missing designated initializers in C++

2023-10-27 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon added a comment. In D157879#4655321 , @rsmith wrote: > This change has introduced a false positive for anonymous union members: > > struct A { > int m; > union { int n = 0; }; > }; > > A a = A{.m = 0}; > > now produces a fal

[PATCH] D157879: [clang] Report missing designated initializers in C++

2023-10-26 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. This change has introduced a false positive for anonymous union members: struct A { int m; union { int n = 0; }; }; A a = A{.m = 0}; now produces a false positive warning saying that the anonymous union member in `A` is uninitialized. Repository:

[PATCH] D157879: [clang] Report missing designated initializers in C++

2023-08-22 Thread Arthur Eubanks via Phabricator via cfe-commits
aeubanks added a comment. In D157879#4606531 , @aaron.ballman wrote: > In D157879#4604288 , @phosek wrote: > >> Note that there's an ongoing discussion on the GCC bug >> https://gcc.gnu.org/bugzilla/show_bug.cgi

[PATCH] D157879: [clang] Report missing designated initializers in C++

2023-08-22 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a subscriber: jwakely. aaron.ballman added a comment. In D157879#4604288 , @phosek wrote: > Note that there's an ongoing discussion on the GCC bug > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96868 whether > `-Wmissing-field-initia

[PATCH] D157879: [clang] Report missing designated initializers in C++

2023-08-21 Thread Ian McKellar via Phabricator via cfe-commits
ianloic added a comment. In 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

[PATCH] D157879: [clang] Report missing designated initializers in C++

2023-08-21 Thread Petr Hosek via Phabricator via cfe-commits
phosek added a comment. Note that there's an ongoing discussion on the GCC bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96868 whether `-Wmissing-field-initializers` should apply to both C and C++ or just C. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.

[PATCH] D157879: [clang] Report missing designated initializers in C++

2023-08-21 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In 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 `reserve

[PATCH] D157879: [clang] Report missing designated initializers in C++

2023-08-21 Thread Arthur Eubanks via Phabricator via cfe-commits
aeubanks added a comment. 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 i

[PATCH] D157879: [clang] Report missing designated initializers in C++

2023-08-21 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D157879#4604046 , @aeubanks wrote: > is there any way to suppress this for a specific field? (I believe) I'm > seeing user code where a field is intentionally not being initialized Hmmm, so they're wanting to rely on th

[PATCH] D157879: [clang] Report missing designated initializers in C++

2023-08-21 Thread Arthur Eubanks via Phabricator via cfe-commits
aeubanks added a comment. is there any way to suppress this for a specific field? (I believe) I'm seeing user code where a field is intentionally not being initialized Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D157879/new/ https://reviews.llvm.

[PATCH] D157879: [clang] Report missing designated initializers in C++

2023-08-21 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG91088978d712: [clang] Report missing designated initializers in C++ (authored by Fznamznon). Repository: rG LLVM Github Monorepo CHANGES SINCE LA

[PATCH] D157879: [clang] Report missing designated initializers in C++

2023-08-21 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon added a comment. The failure is unrelated, since the patch doesn't touch modules and I've seen the test failing for other patches as well. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D157879/new/ https://reviews.llvm.org/D157879 __

[PATCH] D157879: [clang] Report missing designated initializers in C++

2023-08-21 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon updated this revision to Diff 551924. Fznamznon added a comment. Rebase to maybe pass precommit Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D157879/new/ https://reviews.llvm.org/D157879 Files: clang/docs/ReleaseNotes.rst clang/lib/S

[PATCH] D157879: [clang] Report missing designated initializers in C++

2023-08-18 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D157879/new/ https://reviews.llvm.org/D157879

[PATCH] D157879: [clang] Report missing designated initializers in C++

2023-08-18 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon updated this revision to Diff 551460. Fznamznon added a comment. Rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D157879/new/ https://reviews.llvm.org/D157879 Files: clang/docs/ReleaseNotes.rst clang/lib/Sema/SemaInit.cpp clang

[PATCH] D157879: [clang] Report missing designated initializers in C++

2023-08-17 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. In D157879#4595058 , @Fznamznon wrote: > In D157879#4594790 , @tbaeder wrote: > >> Tangentially related: Now that we have this `InitializedFields` set, would >> it be easy to add a warnin

[PATCH] D157879: [clang] Report missing designated initializers in C++

2023-08-17 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon added a comment. In D157879#4594790 , @tbaeder wrote: > Tangentially related: Now that we have this `InitializedFields` set, would it > be easy to add a warning for double-initialization of fields (that would also > trigger in C)? Isn't a war

[PATCH] D157879: [clang] Report missing designated initializers in C++

2023-08-17 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Tangentially related: Now that we have this `InitializedFields` set, would it be easy to add a warning for double-initialization of fields (that would also trigger in C)? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D15787

[PATCH] D157879: [clang] Report missing designated initializers in C++

2023-08-17 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon marked 3 inline comments as done. Fznamznon added a comment. > Thank you for working on this! The changes should come with a release note. Thanks for feedback, I added a release note. > Can we silence the diagnostic in these cases? And this is done. Repository: rG LLVM Github Mono

[PATCH] D157879: [clang] Report missing designated initializers in C++

2023-08-17 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon updated this revision to Diff 551051. Fznamznon added a comment. Add a release note, apply feedback: - Do not report invalid initializers as missing - Fix wrong warning if record has bitfields Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/

[PATCH] D157879: [clang] Report missing designated initializers in C++

2023-08-15 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. Thank you for working on this! The changes should come with a release note. I think the diagnostic is triggered a bit to aggressively in the case where there is an invalid initializer for a field -- we'll claim there is no initializer in that case, but that effect

[PATCH] D157879: [clang] Report missing designated initializers in C++

2023-08-14 Thread Mariya Podchishchaeva via Phabricator via cfe-commits
Fznamznon created this revision. Herald added a project: All. Fznamznon requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Prior to this change clang didn't emit missing-field-initializers warning for designated initializers. The comments say