[clang] [clang] Add -Wmissing-designated-field-initializers (PR #81364)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 12 06:44:15 PST 2024


================
@@ -6165,6 +6165,10 @@ def ext_initializer_string_for_char_array_too_long : ExtWarn<
 def warn_missing_field_initializers : Warning<
   "missing field %0 initializer">,
   InGroup<MissingFieldInitializers>, DefaultIgnore;
+// The same warning, but another group is needed to disable it separately.
+def warn_missing_designated_field_initializers : Warning<
+  "missing field %0 initializer">,
+  InGroup<MissingDesignatedFieldInitializers>, DefaultIgnore;
----------------
AaronBallman wrote:

```suggestion
// The same warning, but another group is needed to disable it separately.
def warn_missing_designated_field_initializers : Warning<
  warn_missing_field_initializers.Summary>,
  InGroup<MissingDesignatedFieldInitializers>, DefaultIgnore;
```
This way we don't have to worry about the two diagnostics getting different wording.

https://github.com/llvm/llvm-project/pull/81364


More information about the cfe-commits mailing list