github-actions[bot] wrote:

<!--LLVM CODE LINT COMMENT: clang-tidy-->


:warning: C/C++ code linter, clang-tidy found issues in your code. :warning:

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

```bash

git diff -U0 origin/main...HEAD -- 
clang-tools-extra/clang-tidy/misc/ScopeReductionCheck.cpp 
clang-tools-extra/clang-tidy/misc/ScopeReductionCheck.h 
clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp |
python3 clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py   -path build -p1 
-quiet
```

</details>

<details>
<summary>
View the output from clang-tidy here.
</summary>

```
clang-tools-extra/clang-tidy/misc/ScopeReductionCheck.cpp:42:1: warning: 
included header ASTUtils.h is not used directly [misc-include-cleaner]
   42 | #include "../utils/ASTUtils.h"
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   43 | #include "clang/AST/ASTContext.h"
clang-tools-extra/clang-tidy/misc/ScopeReductionCheck.cpp:156:17: warning: 
invalid case style for variable 'i' [readability-identifier-naming]
  156 |     for (size_t i = 1; i < UseScopeChains.size(); ++i) {
      |                 ^      ~                            ~
      |                 I      I                            I
  157 |       const CompoundStmt *CommonScope = nullptr;
  158 | 
  159 |       // Find first scope that appears in both chains (common ancestor)
  160 |       for (const auto *Scope1 : UseScopeChains[0]) {
  161 |         for (const auto *Scope2 : UseScopeChains[i]) {
      |                                                  ~
      |                                                  I

clang-tools-extra/clang-tidy/misc/ScopeReductionCheck.h:1:1: warning: header is 
missing header guard [llvm-header-guard]
    1 | 
//===----------------------------------------------------------------------===//
      | ^
clang-tools-extra/clang-tidy/misc/ScopeReductionCheck.h:9:9: warning: 
'LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_SCOPEREDUCTIONCHECK_H' is used as a 
header guard here, followed by #define of a different macro 
[clang-diagnostic-header-guard]
    9 | #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_SCOPEREDUCTIONCHECK_H
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
clang-tools-extra/clang-tidy/misc/ScopeReductionCheck.h:10:9: note: 
'LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_SCOPEREDCUTIONCHECK_H' is defined here; 
did you mean 'LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_SCOPEREDUCTIONCHECK_H'?
   10 | #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_SCOPEREDCUTIONCHECK_H
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |         LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MISC_SCOPEREDUCTIONCHECK_H
clang-tools-extra/clang-tidy/misc/ScopeReductionCheck.h:12:1: warning: included 
header DeclRefExprUtils.h is not used directly [misc-include-cleaner]
   12 | #include "../../clang-tidy/utils/DeclRefExprUtils.h"
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   13 | #include "../ClangTidyCheck.h"
clang-tools-extra/clang-tidy/misc/ScopeReductionCheck.h:14:1: warning: included 
header ASTContext.h is not used directly [misc-include-cleaner]
   14 | #include "clang/AST/ASTContext.h"
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   15 |
```

</details>


https://github.com/llvm/llvm-project/pull/175429
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to