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/portability/NoAssemblerCheck.cpp
clang-tools-extra/clang-tidy/portability/NoAssemblerCheck.h
clang-tools-extra/clang-tidy/hicpp/HICPPTidyModule.cpp
clang-tools-extra/clang-tidy/portability/PortabilityTidyModule.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/portability/NoAssemblerCheck.h:9:9: warning:
header guard does not follow preferred style [llvm-header-guard]
9 | #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_HICPP_NOASSEMBLERCHECK_H
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PORTABILITY_NOASSEMBLERCHECK_H
10 | #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_HICPP_NOASSEMBLERCHECK_H
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_PORTABILITY_NOASSEMBLERCHECK_H
clang-tools-extra/clang-tidy/portability/NoAssemblerCheck.cpp:10:1: warning:
included header ASTMatchFinder.h is not used directly [misc-include-cleaner]
10 | #include "clang/ASTMatchers/ASTMatchFinder.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11 |
clang-tools-extra/clang-tidy/portability/NoAssemblerCheck.cpp:16:6: error: use
of undeclared identifier 'NoAssemblerCheck'; did you mean
'hicpp::NoAssemblerCheck'? [clang-diagnostic-error]
16 | void NoAssemblerCheck::registerMatchers(MatchFinder *Finder) {
| ^~~~~~~~~~~~~~~~
| hicpp::NoAssemblerCheck
clang-tools-extra/clang-tidy/portability/NoAssemblerCheck.h:20:7: note:
'hicpp::NoAssemblerCheck' declared here
20 | class NoAssemblerCheck : public ClangTidyCheck {
| ^
clang-tools-extra/clang-tidy/portability/NoAssemblerCheck.cpp:16:24: error:
cannot define or redeclare 'registerMatchers' here because namespace
'portability' does not enclose namespace 'NoAssemblerCheck'
[clang-diagnostic-error]
16 | void NoAssemblerCheck::registerMatchers(MatchFinder *Finder) {
| ~~~~~~~~~~~~~~~~~~^
clang-tools-extra/clang-tidy/portability/NoAssemblerCheck.cpp:17:3: error: use
of undeclared identifier 'Finder' [clang-diagnostic-error]
17 | Finder->addMatcher(asmStmt().bind("asm-stmt"), this);
| ^~~~~~
clang-tools-extra/clang-tidy/portability/NoAssemblerCheck.cpp:17:50: error:
invalid use of 'this' outside of a non-static member function
[clang-diagnostic-error]
17 | Finder->addMatcher(asmStmt().bind("asm-stmt"), this);
| ^
clang-tools-extra/clang-tidy/portability/NoAssemblerCheck.cpp:18:3: error: use
of undeclared identifier 'Finder' [clang-diagnostic-error]
18 | Finder->addMatcher(fileScopeAsmDecl().bind("asm-file-scope"), this);
| ^~~~~~
clang-tools-extra/clang-tidy/portability/NoAssemblerCheck.cpp:18:65: error:
invalid use of 'this' outside of a non-static member function
[clang-diagnostic-error]
18 | Finder->addMatcher(fileScopeAsmDecl().bind("asm-file-scope"), this);
| ^
clang-tools-extra/clang-tidy/portability/NoAssemblerCheck.cpp:19:3: error: use
of undeclared identifier 'Finder' [clang-diagnostic-error]
19 | Finder->addMatcher(varDecl(hasAttr(attr::AsmLabel)).bind("asm-var"),
this);
| ^~~~~~
clang-tools-extra/clang-tidy/portability/NoAssemblerCheck.cpp:19:72: error:
invalid use of 'this' outside of a non-static member function
[clang-diagnostic-error]
19 | Finder->addMatcher(varDecl(hasAttr(attr::AsmLabel)).bind("asm-var"),
this);
| ^
clang-tools-extra/clang-tidy/portability/NoAssemblerCheck.cpp:22:6: error: use
of undeclared identifier 'NoAssemblerCheck'; did you mean
'hicpp::NoAssemblerCheck'? [clang-diagnostic-error]
22 | void NoAssemblerCheck::check(const MatchFinder::MatchResult &Result) {
| ^~~~~~~~~~~~~~~~
| hicpp::NoAssemblerCheck
clang-tools-extra/clang-tidy/portability/NoAssemblerCheck.h:20:7: note:
'hicpp::NoAssemblerCheck' declared here
20 | class NoAssemblerCheck : public ClangTidyCheck {
| ^
clang-tools-extra/clang-tidy/portability/NoAssemblerCheck.cpp:22:24: error:
cannot define or redeclare 'check' here because namespace 'portability' does
not enclose namespace 'NoAssemblerCheck' [clang-diagnostic-error]
22 | void NoAssemblerCheck::check(const MatchFinder::MatchResult &Result) {
| ~~~~~~~~~~~~~~~~~~^
clang-tools-extra/clang-tidy/portability/NoAssemblerCheck.cpp:23:18: warning:
variable 'ASMLocation' can be made static or moved into an anonymous namespace
to enforce internal linkage [misc-use-internal-linkage]
23 | SourceLocation ASMLocation;
| ^
| static
clang-tools-extra/clang-tidy/portability/NoAssemblerCheck.cpp:24:19: warning:
variable 'ASM' can be made static or moved into an anonymous namespace to
enforce internal linkage [misc-use-internal-linkage]
24 | if (const auto *ASM = Result.Nodes.getNodeAs<AsmStmt>("asm-stmt"))
| ^
| static
clang-tools-extra/clang-tidy/portability/NoAssemblerCheck.cpp:24:25: error: use
of undeclared identifier 'Result' [clang-diagnostic-error]
24 | if (const auto *ASM = Result.Nodes.getNodeAs<AsmStmt>("asm-stmt"))
| ^~~~~~
clang-tools-extra/clang-tidy/portability/NoAssemblerCheck.cpp:26:24: error:
redefinition of 'ASM' [clang-diagnostic-error]
26 | else if (const auto *ASM =
| ^
clang-tools-extra/clang-tidy/portability/NoAssemblerCheck.cpp:24:19: note:
previous definition is here
24 | if (const auto *ASM = Result.Nodes.getNodeAs<AsmStmt>("asm-stmt"))
| ^
clang-tools-extra/clang-tidy/portability/NoAssemblerCheck.cpp:26:24: warning:
variable 'ASM' can be made static or moved into an anonymous namespace to
enforce internal linkage [misc-use-internal-linkage]
26 | else if (const auto *ASM =
| ^
| static
clang-tools-extra/clang-tidy/portability/NoAssemblerCheck.cpp:27:16: error: use
of undeclared identifier 'Result' [clang-diagnostic-error]
27 |
Result.Nodes.getNodeAs<FileScopeAsmDecl>("asm-file-scope"))
| ^~~~~~
clang-tools-extra/clang-tidy/portability/NoAssemblerCheck.cpp:29:24: error:
redefinition of 'ASM' [clang-diagnostic-error]
29 | else if (const auto *ASM = Result.Nodes.getNodeAs<VarDecl>("asm-var"))
| ^
clang-tools-extra/clang-tidy/portability/NoAssemblerCheck.cpp:26:24: note:
previous definition is here
26 | else if (const auto *ASM =
| ^
clang-tools-extra/clang-tidy/portability/NoAssemblerCheck.cpp:29:24: warning:
variable 'ASM' can be made static or moved into an anonymous namespace to
enforce internal linkage [misc-use-internal-linkage]
29 | else if (const auto *ASM = Result.Nodes.getNodeAs<VarDecl>("asm-var"))
| ^
| static
clang-tools-extra/clang-tidy/portability/NoAssemblerCheck.cpp:29:30: error: use
of undeclared identifier 'Result' [clang-diagnostic-error]
29 | else if (const auto *ASM = Result.Nodes.getNodeAs<VarDecl>("asm-var"))
| ^~~~~~
clang-tools-extra/clang-tidy/portability/NoAssemblerCheck.cpp:34:3: error:
unexpected namespace name 'diag': expected expression [clang-diagnostic-error]
34 | diag(ASMLocation, "do not use inline assembler in safety-critical
code");
| ^
clang-tools-extra/clang-tidy/hicpp/HICPPTidyModule.cpp:33:1: warning: included
header NoAssemblerCheck.h is not used directly [misc-include-cleaner]
33 | #include "../portability/NoAssemblerCheck.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
34 | #include "../readability/BracesAroundStatementsCheck.h"
clang-tools-extra/clang-tidy/hicpp/HICPPTidyModule.cpp:84:34: error: use of
undeclared identifier 'portability' [clang-diagnostic-error]
84 | CheckFactories.registerCheck<portability::NoAssemblerCheck>(
| ^
clang-tools-extra/clang-tidy/portability/PortabilityTidyModule.cpp:27:34:
error: unknown type name 'NoAssemblerCheck'; did you mean
'hicpp::NoAssemblerCheck'? [clang-diagnostic-error]
27 | CheckFactories.registerCheck<NoAssemblerCheck>(
| ^~~~~~~~~~~~~~~~
| hicpp::NoAssemblerCheck
clang-tools-extra/clang-tidy/portability/NoAssemblerCheck.h:20:7: note:
'hicpp::NoAssemblerCheck' declared here
20 | class NoAssemblerCheck : public ClangTidyCheck {
| ^
```
</details>
https://github.com/llvm/llvm-project/pull/184030
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits