llvmbot wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang-tidy

Author: Marie Zhussupova (phychee)

<details>
<summary>Changes</summary>

Fixes #&lt;117431&gt;

---
Full diff: https://github.com/llvm/llvm-project/pull/117521.diff


2 Files Affected:

- (modified) clang-tools-extra/clang-tidy/misc/ConstCorrectnessCheck.cpp (-3) 
- (modified) clang/include/clang/ASTMatchers/ASTMatchers.h (+5) 


``````````diff
diff --git a/clang-tools-extra/clang-tidy/misc/ConstCorrectnessCheck.cpp 
b/clang-tools-extra/clang-tidy/misc/ConstCorrectnessCheck.cpp
index 71a4cee4bdc6ef..7c159d8dd8659b 100644
--- a/clang-tools-extra/clang-tidy/misc/ConstCorrectnessCheck.cpp
+++ b/clang-tools-extra/clang-tidy/misc/ConstCorrectnessCheck.cpp
@@ -17,9 +17,6 @@ using namespace clang::ast_matchers;
 namespace clang::tidy::misc {
 
 namespace {
-// FIXME: This matcher exists in some other code-review as well.
-// It should probably move to ASTMatchers.
-AST_MATCHER(VarDecl, isLocal) { return Node.isLocalVarDecl(); }
 AST_MATCHER_P(DeclStmt, containsAnyDeclaration,
               ast_matchers::internal::Matcher<Decl>, InnerMatcher) {
   return ast_matchers::internal::matchesFirstInPointerRange(
diff --git a/clang/include/clang/ASTMatchers/ASTMatchers.h 
b/clang/include/clang/ASTMatchers/ASTMatchers.h
index 4bcaa953a61af2..f8388028d2ccbe 100644
--- a/clang/include/clang/ASTMatchers/ASTMatchers.h
+++ b/clang/include/clang/ASTMatchers/ASTMatchers.h
@@ -739,6 +739,11 @@ AST_MATCHER(FunctionDecl, isMain) {
   return Node.isMain();
 }
 
+// Matches variable declarations that represent local variables.
+AST_MATCHER(VarDecl, isLocal) { 
+    return Node.isLocalVarDecl(); 
+}
+
 /// Matches the specialized template of a specialization declaration.
 ///
 /// Given

``````````

</details>


https://github.com/llvm/llvm-project/pull/117521
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to