Re: [PATCH] D32914: Introduce Wzero-as-null-pointer-constant.

2017-07-13 Thread Nico Weber via cfe-commits
On Thu, Jul 13, 2017 at 1:38 PM, Roman Lebedev via Phabricator via cfe-commits wrote: > lebedev.ri added a comment. > > PR #33771 filled. > IMHO the problems with this diagnostic should be resolved before 5.0 > iirc gcc warns in that case too (?) Als

[PATCH] D32914: Introduce Wzero-as-null-pointer-constant.

2017-07-13 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. PR #33771 filled. IMHO the problems with this diagnostic should be resolved before 5.0 https://reviews.llvm.org/D32914 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D32914: Introduce Wzero-as-null-pointer-constant.

2017-07-05 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. @thakis ping? https://reviews.llvm.org/D32914 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D32914: Introduce Wzero-as-null-pointer-constant.

2017-05-08 Thread Malcolm Parsons via Phabricator via cfe-commits
malcolm.parsons added a comment. Have you looked at the tests for clang-tidy's modernize-use-nullptr check? I wouldn't expect to see a warning for template types: template class TemplateClass { public: explicit TemplateClass(int a, T default_value = 0) {} }; void IgnoreSubstTempla

[PATCH] D32914: Introduce Wzero-as-null-pointer-constant.

2017-05-07 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. And a lot of warnings from code using googletest, highlight: ../src/librawspeed/metadata/ColorFilterArrayTest.cpp:56:1: error: zero as null pointer constant [-Werror,-Wzero-as-null-pointer-constant] TEST(ColorFilterArrayTestBasic, Constructor) { ^ googletest/g

[PATCH] D32914: Introduce Wzero-as-null-pointer-constant.

2017-05-07 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. This warning complains about macros from system headers, e.g. `PTHREAD_MUTEX_INITIALIZER`: $ ninja -j1 -v [1/110] /usr/bin/cmake -E __run_iwyu --tidy=/usr/local/bin/clang-tidy --source=../src/librawspeed/common/DngOpcodes.cpp -- /usr/local/bin/clang++ -DDEBUG -

[PATCH] D32914: Introduce Wzero-as-null-pointer-constant.

2017-05-05 Thread Nico Weber via Phabricator via cfe-commits
thakis marked an inline comment as done. thakis added a comment. s/Add one/All done/ https://reviews.llvm.org/D32914 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D32914: Introduce Wzero-as-null-pointer-constant.

2017-05-05 Thread Nico Weber via Phabricator via cfe-commits
thakis closed this revision. thakis marked 3 inline comments as done. thakis added a comment. Thanks! Add one and landed in r302247. Comment at: include/clang/Sema/Sema.h:3760 + /// \brief Warn when implicitly casting 0 to nullptr. + void diagnoseZeroToNullptrConversion(Cas

[PATCH] D32914: Introduce Wzero-as-null-pointer-constant.

2017-05-05 Thread Hans Wennborg via Phabricator via cfe-commits
hans accepted this revision. hans added a comment. This revision is now accepted and ready to land. Nice. Some comments, but lgtm. Comment at: include/clang/Sema/Sema.h:3760 + /// \brief Warn when implicitly casting 0 to nullptr. + void diagnoseZeroToNullptrConversion(CastK

[PATCH] D32914: Introduce Wzero-as-null-pointer-constant.

2017-05-05 Thread Nico Weber via Phabricator via cfe-commits
thakis created this revision. Add an opt-in warning that fires when 0 is used as a null pointer. gcc has this warning, and there's some demand for it: http://stackoverflow.com/questions/34953361/which-clang-warning-is-equivalent-to-wzero-as-null-pointer-constant-from-gcc https://twitter.com/Steph