Skip to content

Conversation

@FabianWolff
Copy link
Member

Follow-up to #141092.

@llvmbot
Copy link
Member

llvmbot commented May 27, 2025

@llvm/pr-subscribers-clang-tools-extra

Author: None (FabianWolff)

Changes

Follow-up to #141092.


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

2 Files Affected:

  • (modified) clang-tools-extra/clang-tidy/readability/RedundantSmartptrGetCheck.cpp (+2-2)
  • (modified) clang-tools-extra/docs/ReleaseNotes.rst (+3)
diff --git a/clang-tools-extra/clang-tidy/readability/RedundantSmartptrGetCheck.cpp b/clang-tools-extra/clang-tidy/readability/RedundantSmartptrGetCheck.cpp
index baa977750d101..9774d93ff36fd 100644
--- a/clang-tools-extra/clang-tidy/readability/RedundantSmartptrGetCheck.cpp
+++ b/clang-tools-extra/clang-tidy/readability/RedundantSmartptrGetCheck.cpp
@@ -66,8 +66,8 @@ void registerMatchersForGetArrowStart(MatchFinder *Finder,
 
   // Make sure we are not missing the known standard types.
   const auto SmartptrAny = anyOf(knownSmartptr(), QuacksLikeASmartptr);
-  const auto SmartptrWithDeref =
-      anyOf(cxxRecordDecl(knownSmartptr(), HasRelevantOps), QuacksLikeASmartptr);
+  const auto SmartptrWithDeref = anyOf(
+      cxxRecordDecl(knownSmartptr(), HasRelevantOps), QuacksLikeASmartptr);
 
   // Catch 'ptr.get()->Foo()'
   Finder->addMatcher(
diff --git a/clang-tools-extra/docs/ReleaseNotes.rst b/clang-tools-extra/docs/ReleaseNotes.rst
index d6f2d2b37624e..bc9f4a4a11bcc 100644
--- a/clang-tools-extra/docs/ReleaseNotes.rst
+++ b/clang-tools-extra/docs/ReleaseNotes.rst
@@ -114,6 +114,9 @@ Improvements to clang-tidy
 - Fixed bug in :program:`run_clang_tidy.py` where the program would not
   correctly display the checks enabled by the top-level `.clang-tidy` file.
 
+- Fixed some false positives in the ``readability-redundant-smartptr-get``
+  check involving smart pointers to arrays.
+
 New checks
 ^^^^^^^^^^
 

@llvmbot
Copy link
Member

llvmbot commented May 27, 2025

@llvm/pr-subscribers-clang-tidy

Author: None (FabianWolff)

Changes

Follow-up to #141092.


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

2 Files Affected:

  • (modified) clang-tools-extra/clang-tidy/readability/RedundantSmartptrGetCheck.cpp (+2-2)
  • (modified) clang-tools-extra/docs/ReleaseNotes.rst (+3)
diff --git a/clang-tools-extra/clang-tidy/readability/RedundantSmartptrGetCheck.cpp b/clang-tools-extra/clang-tidy/readability/RedundantSmartptrGetCheck.cpp
index baa977750d101..9774d93ff36fd 100644
--- a/clang-tools-extra/clang-tidy/readability/RedundantSmartptrGetCheck.cpp
+++ b/clang-tools-extra/clang-tidy/readability/RedundantSmartptrGetCheck.cpp
@@ -66,8 +66,8 @@ void registerMatchersForGetArrowStart(MatchFinder *Finder,
 
   // Make sure we are not missing the known standard types.
   const auto SmartptrAny = anyOf(knownSmartptr(), QuacksLikeASmartptr);
-  const auto SmartptrWithDeref =
-      anyOf(cxxRecordDecl(knownSmartptr(), HasRelevantOps), QuacksLikeASmartptr);
+  const auto SmartptrWithDeref = anyOf(
+      cxxRecordDecl(knownSmartptr(), HasRelevantOps), QuacksLikeASmartptr);
 
   // Catch 'ptr.get()->Foo()'
   Finder->addMatcher(
diff --git a/clang-tools-extra/docs/ReleaseNotes.rst b/clang-tools-extra/docs/ReleaseNotes.rst
index d6f2d2b37624e..bc9f4a4a11bcc 100644
--- a/clang-tools-extra/docs/ReleaseNotes.rst
+++ b/clang-tools-extra/docs/ReleaseNotes.rst
@@ -114,6 +114,9 @@ Improvements to clang-tidy
 - Fixed bug in :program:`run_clang_tidy.py` where the program would not
   correctly display the checks enabled by the top-level `.clang-tidy` file.
 
+- Fixed some false positives in the ``readability-redundant-smartptr-get``
+  check involving smart pointers to arrays.
+
 New checks
 ^^^^^^^^^^
 

@kadircet kadircet requested a review from vbvictor May 27, 2025 12:27
Copy link
Contributor

@vbvictor vbvictor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kadircet kadircet merged commit 317f3bd into llvm:main May 27, 2025
11 of 12 checks passed
@FabianWolff FabianWolff deleted the rrspg-array branch May 28, 2025 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants