[clang] [clang][NFC] Fix example code for memberPointerType() AST matcher (PR #109404)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 20 04:37:03 PDT 2024
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 b8b8fbe19dea2825b801c4738ff78dbf26aae430 66c089307601a52f5247a43f18ed4b29ea1a7599 --extensions cpp,h -- clang-tools-extra/clang-tidy/bugprone/BitCastPointersCheck.cpp clang-tools-extra/clang-tidy/bugprone/BitCastPointersCheck.h clang-tools-extra/test/clang-tidy/checkers/bugprone/bit-cast-pointers.cpp clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp clang/include/clang/ASTMatchers/ASTMatchers.h
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang-tools-extra/clang-tidy/bugprone/BitCastPointersCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/BitCastPointersCheck.cpp
index 4589a35a56..1f5fa9c160 100644
--- a/clang-tools-extra/clang-tidy/bugprone/BitCastPointersCheck.cpp
+++ b/clang-tools-extra/clang-tidy/bugprone/BitCastPointersCheck.cpp
@@ -24,7 +24,8 @@ void BitCastPointersCheck::registerMatchers(MatchFinder *Finder) {
void BitCastPointersCheck::check(const MatchFinder::MatchResult &Result) {
if (const auto *MatchedDecl = Result.Nodes.getNodeAs<CallExpr>("x"))
- diag(MatchedDecl->getBeginLoc(), "do not use std::bit_cast on pointers; use reinterpret_cast instead");
+ diag(MatchedDecl->getBeginLoc(),
+ "do not use std::bit_cast on pointers; use reinterpret_cast instead");
}
} // namespace clang::tidy::bugprone
``````````
</details>
https://github.com/llvm/llvm-project/pull/109404
More information about the cfe-commits
mailing list