[clang] [Clang] Diagnose require_explicit_initialization for C tentative definitions (PR #234210)
Chen Miao via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 21 09:51:48 PDT 2026
================
@@ -419,6 +419,11 @@ features cannot lower the translation-unit ABI level;
### Improvements to Clang's diagnostics
+- `-Wuninitialized-explicit-init` now diagnoses C tentative definitions that are
+ never completed with an initializer, such as `struct S s;` at file scope,
+ which leave fields marked `require_explicit_initialization` zero-initialized.
+ (#GH232483)
----------------
ChenMiaoi wrote:
How about this? The warning is about the lack of explicit initialization, rather than zero-initialization itself.
``` suggestion
- Fixed missing `-Wuninitialized-explicit-init` warnings for C file-scope
tentative definitions containing fields marked `require_explicit_initialization`.
(#GH232483)
```
https://github.com/llvm/llvm-project/pull/234210
More information about the cfe-commits
mailing list