Index: clang-tidy/modernize/UseNullptrCheck.cpp =================================================================== --- clang-tidy/modernize/UseNullptrCheck.cpp +++ clang-tidy/modernize/UseNullptrCheck.cpp @@ -190,8 +190,10 @@ bool VisitStmt(Stmt *S) { auto *C = dyn_cast(S); // Catch the castExpr inside cxxDefaultArgExpr. - if (auto *E = dyn_cast(S)) + if (auto *E = dyn_cast(S)) { C = dyn_cast(E->getExpr()); + FirstSubExpr = nullptr; + } if (!C) { FirstSubExpr = nullptr; return true; Index: test/clang-tidy/modernize-use-nullptr.cpp =================================================================== --- test/clang-tidy/modernize-use-nullptr.cpp +++ test/clang-tidy/modernize-use-nullptr.cpp @@ -228,3 +228,19 @@ void test_default_argument() { D(nullptr); } + +// Test on two neighbour CXXDefaultArgExprs nodes. +typedef unsigned long long uint64; +struct ZZ { + explicit ZZ(uint64, const uint64* = NULL) {} +// CHECK-MESSAGES: :[[@LINE-1]]:39: warning: use nullptr +// CHECK-FIXES: explicit ZZ(uint64, const uint64* = nullptr) {} + operator bool() { return true; } +}; + +uint64 Hash(uint64 seed = 0) { return 0; } + +void f() { + bool a; + a = ZZ(Hash()); +}