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,h --
clang/test/Sema/Inputs/warn-unused-but-set-static-global-header.h
clang/test/Sema/warn-unused-but-set-static-global.c
clang/test/Sema/warn-unused-but-set-static-global.cpp
clang/include/clang/AST/Decl.h clang/lib/Sema/Sema.cpp
clang/lib/Sema/SemaDecl.cpp clang/lib/Sema/SemaExpr.cpp
clang/test/C/C2y/n3622.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/Sema.cpp b/clang/lib/Sema/Sema.cpp
index 081f90492..eb2c39738 100644
--- a/clang/lib/Sema/Sema.cpp
+++ b/clang/lib/Sema/Sema.cpp
@@ -1591,7 +1591,8 @@ void Sema::ActOnEndOfTranslationUnit() {
if (!Diags.isIgnored(diag::warn_unused_but_set_variable, SourceLocation())) {
// Diagnose unused-but-set static globals in a deterministic order.
- // Not tracking shadowing info for static globals; there's nothing to
shadow.
+ // Not tracking shadowing info for static globals; there's nothing to
+ // shadow.
struct LocAndDiag {
SourceLocation Loc;
PartialDiagnostic PD;
@@ -1614,11 +1615,11 @@ void Sema::ActOnEndOfTranslationUnit() {
}
llvm::sort(DeclDiags,
- [](const LocAndDiag &LHS, const LocAndDiag &RHS) -> bool {
- // Sorting purely for determinism; matches behavior in
- // Sema::ActOnPopScope.
- return LHS.Loc.getRawEncoding() < RHS.Loc.getRawEncoding();
- });
+ [](const LocAndDiag &LHS, const LocAndDiag &RHS) -> bool {
+ // Sorting purely for determinism; matches behavior in
+ // Sema::ActOnPopScope.
+ return LHS.Loc.getRawEncoding() < RHS.Loc.getRawEncoding();
+ });
for (const LocAndDiag &D : DeclDiags)
Diag(D.Loc, D.PD);
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/178342
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits