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 origin/main HEAD --extensions c,cpp --
clang/lib/Sema/SemaInit.cpp clang/test/Sema/init.c --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</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 5a097dcb2..fd00b1d02 100644
--- a/clang/lib/Sema/SemaInit.cpp
+++ b/clang/lib/Sema/SemaInit.cpp
@@ -1362,8 +1362,8 @@ void InitListChecker::CheckExplicitInitList(const
InitializedEntity &Entity,
// Don't complain for incomplete types, since we'll get an error elsewhere.
if ((Index < IList->getNumInits() || CurEmbed) && !T->isIncompleteType()) {
// We have leftover initializers
- Expr *ExtraInit = Index < IList->getNumInits() ? IList->getInit(Index)
- : CurEmbed;
+ Expr *ExtraInit =
+ Index < IList->getNumInits() ? IList->getInit(Index) : CurEmbed;
SourceLocation ExtraInitLoc =
ExtraInit ? ExtraInit->getBeginLoc() : IList->getEndLoc();
SourceRange ExtraInitRange =
@@ -1373,8 +1373,7 @@ void InitListChecker::CheckExplicitInitList(const
InitializedEntity &Entity,
hadError = ExtraInitsIsError;
if (VerifyOnly) {
return;
- } else if (StructuredIndex == 1 &&
- StructuredList->getNumInits() != 0 &&
+ } else if (StructuredIndex == 1 && StructuredList->getNumInits() != 0 &&
StructuredList->getInit(0) &&
IsStringInit(StructuredList->getInit(0), T, SemaRef.Context) ==
SIF_None) {
``````````
</details>
https://github.com/llvm/llvm-project/pull/192471
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits