This revision was automatically updated to reflect the committed changes.
Closed by commit rL262698: [clang-tidy] Make 'modernize-use-nullptr' check work 
on multiple nested… (authored by hokein).

Changed prior to commit:
  http://reviews.llvm.org/D17849?vs=49736&id=49802#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D17849

Files:
  clang-tools-extra/trunk/clang-tidy/modernize/UseNullptrCheck.cpp
  clang-tools-extra/trunk/test/clang-tidy/modernize-use-nullptr-basic.cpp

Index: clang-tools-extra/trunk/test/clang-tidy/modernize-use-nullptr-basic.cpp
===================================================================
--- clang-tools-extra/trunk/test/clang-tidy/modernize-use-nullptr-basic.cpp
+++ clang-tools-extra/trunk/test/clang-tidy/modernize-use-nullptr-basic.cpp
@@ -327,6 +327,21 @@
   // CHECK-FIXES: const int *const_p6 = static_cast<int*>(t ? t : 
static_cast<int*>(nullptr));
 }
 
+void test_nested_implicit_cast_expr() {
+  int func0(void*, void*);
+  int func1(int, void*, void*);
+
+  (double)func1(0, 0, 0);
+  // CHECK-MESSAGES: :[[@LINE-1]]:20: warning: use nullptr
+  // CHECK-MESSAGES: :[[@LINE-2]]:23: warning: use nullptr
+  // CHECK-FIXES: (double)func1(0, nullptr, nullptr);
+  (double)func1(func0(0, 0), 0, 0);
+  // CHECK-MESSAGES: :[[@LINE-1]]:23: warning: use nullptr
+  // CHECK-MESSAGES: :[[@LINE-2]]:26: warning: use nullptr
+  // CHECK-MESSAGES: :[[@LINE-3]]:30: warning: use nullptr
+  // CHECK-MESSAGES: :[[@LINE-4]]:33: warning: use nullptr
+  // CHECK-FIXES: (double)func1(func0(nullptr, nullptr), nullptr, nullptr);
+}
 
 // FIXME: currently, the check doesn't work as it should with templates.
 template<typename T>
Index: clang-tools-extra/trunk/clang-tidy/modernize/UseNullptrCheck.cpp
===================================================================
--- clang-tools-extra/trunk/clang-tidy/modernize/UseNullptrCheck.cpp
+++ clang-tools-extra/trunk/clang-tidy/modernize/UseNullptrCheck.cpp
@@ -252,7 +252,7 @@
     }
     replaceWithNullptr(Check, SM, StartLoc, EndLoc);
 
-    return skipSubTree();
+    return true;
   }
 
 private:


Index: clang-tools-extra/trunk/test/clang-tidy/modernize-use-nullptr-basic.cpp
===================================================================
--- clang-tools-extra/trunk/test/clang-tidy/modernize-use-nullptr-basic.cpp
+++ clang-tools-extra/trunk/test/clang-tidy/modernize-use-nullptr-basic.cpp
@@ -327,6 +327,21 @@
   // CHECK-FIXES: const int *const_p6 = static_cast<int*>(t ? t : static_cast<int*>(nullptr));
 }
 
+void test_nested_implicit_cast_expr() {
+  int func0(void*, void*);
+  int func1(int, void*, void*);
+
+  (double)func1(0, 0, 0);
+  // CHECK-MESSAGES: :[[@LINE-1]]:20: warning: use nullptr
+  // CHECK-MESSAGES: :[[@LINE-2]]:23: warning: use nullptr
+  // CHECK-FIXES: (double)func1(0, nullptr, nullptr);
+  (double)func1(func0(0, 0), 0, 0);
+  // CHECK-MESSAGES: :[[@LINE-1]]:23: warning: use nullptr
+  // CHECK-MESSAGES: :[[@LINE-2]]:26: warning: use nullptr
+  // CHECK-MESSAGES: :[[@LINE-3]]:30: warning: use nullptr
+  // CHECK-MESSAGES: :[[@LINE-4]]:33: warning: use nullptr
+  // CHECK-FIXES: (double)func1(func0(nullptr, nullptr), nullptr, nullptr);
+}
 
 // FIXME: currently, the check doesn't work as it should with templates.
 template<typename T>
Index: clang-tools-extra/trunk/clang-tidy/modernize/UseNullptrCheck.cpp
===================================================================
--- clang-tools-extra/trunk/clang-tidy/modernize/UseNullptrCheck.cpp
+++ clang-tools-extra/trunk/clang-tidy/modernize/UseNullptrCheck.cpp
@@ -252,7 +252,7 @@
     }
     replaceWithNullptr(Check, SM, StartLoc, EndLoc);
 
-    return skipSubTree();
+    return true;
   }
 
 private:
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to