aaron.ballman added inline comments.
================ Comment at: test/clang-tidy/readability-delete-null-pointer.cpp:7 + int *p = 0; + if (p) { + // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: 'if' statement is unnecessary; deleting null pointer has no effect [readability-delete-null-pointer] ---------------- hokein wrote: > Does it work the case like: > > ``` > int *p = nullptr; > if (p == nullptr) { > p = new int[3]; > delete[] p; > } > ``` > > ? Similarly, it should not mishandle a case like: void f(int *p) { if (p) { delete p; } else { // Do something else } } ================ Comment at: test/clang-tidy/readability-delete-null-pointer.cpp:59 +} \ No newline at end of file ---------------- Please add a newline. https://reviews.llvm.org/D21298 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits