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

via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 4 14:43:59 PST 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 5dc9e87c8cae7842edcaa4dd01308873109208da fa70ace81c2311636ce369259aded2b8f40ad0d6 -- clang/lib/Sema/SemaInit.cpp clang/test/SemaCXX/cxx2a-initializer-aggregates.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/Sema/SemaInit.cpp b/clang/lib/Sema/SemaInit.cpp
index e44752bb03..bb8748f443 100644
--- a/clang/lib/Sema/SemaInit.cpp
+++ b/clang/lib/Sema/SemaInit.cpp
@@ -2358,7 +2358,8 @@ void InitListChecker::CheckStructUnionTypes(
   // Emit warnings for missing struct field initializers.
   // This check is disabled for designated initializers in C.
   // This matches gcc behaviour.
-  bool IsCDesignatedInitializer = HasDesignatedInit && !SemaRef.getLangOpts().CPlusPlus;
+  bool IsCDesignatedInitializer =
+      HasDesignatedInit && !SemaRef.getLangOpts().CPlusPlus;
   if (!VerifyOnly && InitializedSomething && !RD->isUnion() &&
       !IList->isIdiomaticZeroInitializer(SemaRef.getLangOpts()) &&
       !IsCDesignatedInitializer) {

``````````

</details>


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


More information about the cfe-commits mailing list