[clang-tools-extra] [clang-tidy] Add checker alias framework and restore hicpp aliases (PR #197927)
via cfe-commits
cfe-commits at lists.llvm.org
Fri May 15 06:10:39 PDT 2026
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/aliases/ClangTidyAliases.cpp clang-tools-extra/clang-tidy/aliases/ClangTidyAliases.h clang-tools-extra/clang-tidy/ClangTidy.cpp clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.h clang-tools-extra/clang-tidy/ClangTidyForceLinker.h clang-tools-extra/clang-tidy/ClangTidyModule.cpp clang-tools-extra/clang-tidy/ClangTidyModule.h clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp clang-tools-extra/clang-tidy/tool/ClangTidyMain.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/ClangTidyModule.h:13:1: warning: included header SmallVector.h is not used directly [misc-include-cleaner]
13 | #include "llvm/ADT/SmallVector.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14 | #include "llvm/ADT/StringMap.h"
clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp:276:5: warning: variable 'IsNegative' of type 'bool' can be declared 'const' [misc-const-correctness]
276 | bool IsNegative = Remaining.consume_front("-");
| ^
| const
clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp:295:10: warning: variable 'C' of type 'char' can be declared 'const' [misc-const-correctness]
295 | for (char C : Glob) {
| ^
| const
clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp:296:20: warning: statement should have braces [readability-inconsistent-ifelse-braces]
296 | if (C == '*')
| ^
| {
297 | RegexText.append(".*");
298 | else if (StringRef("()^$|+?.[]\\{}").contains(C)) {
| }
clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp:306:5: warning: variable 'Re' of type 'llvm::Regex' can be declared 'const' [misc-const-correctness]
306 | llvm::Regex Re(RegexText);
| ^
| const
clang-tools-extra/clang-tidy/aliases/ClangTidyAliases.cpp:65:12: warning: unused variable 'Result' [clang-diagnostic-unused-variable]
65 | auto Result = M->try_emplace(A, Canonical);
| ^~~~~~
clang-tools-extra/clang-tidy/aliases/ClangTidyAliases.cpp:80:12: warning: unused variable 'Result' [clang-diagnostic-unused-variable]
80 | auto Result = M->try_emplace(Canon, Alias);
| ^~~~~~
clang-tools-extra/clang-tidy/aliases/ClangTidyAliases.cpp:112:14: warning: variable 'AliasesModuleAnchorSource' can be made static or moved into an anonymous namespace to enforce internal linkage [misc-use-internal-linkage]
112 | volatile int AliasesModuleAnchorSource = 0;
| ^
| static
clang-tools-extra/clang-tidy/aliases/ClangTidyAliases.h:9:9: warning: header guard does not follow preferred style [llvm-header-guard]
9 | #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYALIASES_H
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ALIASES_CLANGTIDYALIASES_H
10 | #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYALIASES_H
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ALIASES_CLANGTIDYALIASES_H
clang-tools-extra/clang-tidy/aliases/ClangTidyAliases.h:13:1: warning: included header ArrayRef.h is not used directly [misc-include-cleaner]
13 | #include "llvm/ADT/ArrayRef.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14 | #include <utility>
clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp:669:5: warning: variable 'OriginalFilter' of type 'GlobList' can be declared 'const' [misc-const-correctness]
669 | GlobList OriginalFilter(StringRef(EffectiveOptions.Checks.value_or("")),
| ^
| const
```
</details>
https://github.com/llvm/llvm-project/pull/197927
More information about the cfe-commits
mailing list