[clang-tools-extra] f9e7f95 - [clang-tidy] Fix `modernize-use-nullptr` crash on 32-bit Windows (#160023)

via cfe-commits cfe-commits at lists.llvm.org
Sat Sep 27 23:25:55 PDT 2025


Author: Victor Chernyakin
Date: 2025-09-27T23:25:51-07:00
New Revision: f9e7f95b3dfceac8b680ad2f3d5f35543c0d46ae

URL: https://github.com/llvm/llvm-project/commit/f9e7f95b3dfceac8b680ad2f3d5f35543c0d46ae
DIFF: https://github.com/llvm/llvm-project/commit/f9e7f95b3dfceac8b680ad2f3d5f35543c0d46ae.diff

LOG: [clang-tidy] Fix `modernize-use-nullptr` crash on 32-bit Windows (#160023)

Fixes #53778.

Added: 
    

Modified: 
    clang-tools-extra/clang-tidy/modernize/UseNullptrCheck.cpp
    clang-tools-extra/docs/ReleaseNotes.rst

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clang-tidy/modernize/UseNullptrCheck.cpp b/clang-tools-extra/clang-tidy/modernize/UseNullptrCheck.cpp
index 4dc4baecddd50..4084d713665ea 100644
--- a/clang-tools-extra/clang-tidy/modernize/UseNullptrCheck.cpp
+++ b/clang-tools-extra/clang-tidy/modernize/UseNullptrCheck.cpp
@@ -53,7 +53,7 @@ StatementMatcher makeCastSequenceMatcher(llvm::ArrayRef<StringRef> NameList) {
       unless(hasImplicitDestinationType(
           qualType(matchers::matchesAnyListedTypeName(NameList)))));
 
-  auto IsOrHasDescendant = [](auto InnerMatcher) {
+  auto IsOrHasDescendant = [](const auto &InnerMatcher) {
     return anyOf(InnerMatcher, hasDescendant(InnerMatcher));
   };
 

diff  --git a/clang-tools-extra/docs/ReleaseNotes.rst b/clang-tools-extra/docs/ReleaseNotes.rst
index 9257dc6b98ba2..c3a6d2f9b2890 100644
--- a/clang-tools-extra/docs/ReleaseNotes.rst
+++ b/clang-tools-extra/docs/ReleaseNotes.rst
@@ -329,6 +329,11 @@ Changes in existing checks
   <clang-tidy/checks/modernize/use-designated-initializers>` check to
   suggest using designated initializers for aliased aggregate types.
 
+- Improved :doc:`modernize-use-nullptr
+  <clang-tidy/checks/modernize/use-nullptr>` check by fixing a crash
+  on Windows when the check was enabled with a 32-bit :program:`clang-tidy`
+  binary.
+
 - Improved :doc:`modernize-use-std-format
   <clang-tidy/checks/modernize/use-std-format>` check to correctly match
   when the format string is converted to a 
diff erent type by an implicit


        


More information about the cfe-commits mailing list