[PATCH] D39301: Ignore implicity casts for zero-as-null-pointer-constant warning

2017-10-25 Thread Erich Keane via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL316605: Ignore implicity casts for zero-as-null-pointer-constant warning (authored by erichkeane). Changed prior to commit: https://reviews.llvm.org/D39301?vs=120289&id=120301#toc Repository: rL LLVM

[PATCH] D39301: Ignore implicity casts for zero-as-null-pointer-constant warning

2017-10-25 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In https://reviews.llvm.org/D39301#906911, @thakis wrote: > Awesome, thanks much! Like lebedev.ri says, adding a test for the "Parens" > part would be good. I agree. I should have been more explicit with my LGTM, but I presumed you knew to add the tests already.

[PATCH] D39301: Ignore implicity casts for zero-as-null-pointer-constant warning

2017-10-25 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added a comment. They've got me presenting in the next meeting, but i'll add said test and commit after. Thanks for the reviews guys! https://reviews.llvm.org/D39301 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.l

[PATCH] D39301: Ignore implicity casts for zero-as-null-pointer-constant warning

2017-10-25 Thread Nico Weber via Phabricator via cfe-commits
thakis accepted this revision. thakis added a comment. Awesome, thanks much! Like lebedev.ri says, adding a test for the "Parens" part would be good. https://reviews.llvm.org/D39301 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lis

[PATCH] D39301: Ignore implicity casts for zero-as-null-pointer-constant warning

2017-10-25 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM! https://reviews.llvm.org/D39301 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman

[PATCH] D39301: Ignore implicity casts for zero-as-null-pointer-constant warning

2017-10-25 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: lib/Sema/Sema.cpp:441 return; - if (E->getType()->isNullPtrType()) + if (E->IgnoreImpCasts()->getType()->isNullPtrType()) return; erichkeane wrote: > aaron.ballman wrote: > > Do we also want to ignore pare

[PATCH] D39301: Ignore implicity casts for zero-as-null-pointer-constant warning

2017-10-25 Thread Erich Keane via Phabricator via cfe-commits
erichkeane updated this revision to Diff 120289. erichkeane added a comment. Lets ignore parens too! https://reviews.llvm.org/D39301 Files: lib/Sema/Sema.cpp test/SemaCXX/warn-zero-nullptr.cpp Index: lib/Sema/Sema.cpp === ---

[PATCH] D39301: Ignore implicity casts for zero-as-null-pointer-constant warning

2017-10-25 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added inline comments. Comment at: lib/Sema/Sema.cpp:441 return; - if (E->getType()->isNullPtrType()) + if (E->IgnoreImpCasts()->getType()->isNullPtrType()) return; aaron.ballman wrote: > Do we also want to ignore parens here as well with

[PATCH] D39301: Ignore implicity casts for zero-as-null-pointer-constant warning

2017-10-25 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: lib/Sema/Sema.cpp:441 return; - if (E->getType()->isNullPtrType()) + if (E->IgnoreImpCasts()->getType()->isNullPtrType()) return; Do we also want to ignore parens here as well with `Expr::IgnoreParenIm

[PATCH] D39301: Ignore implicity casts for zero-as-null-pointer-constant warning

2017-10-25 Thread Erich Keane via Phabricator via cfe-commits
erichkeane updated this revision to Diff 120288. erichkeane marked an inline comment as done. erichkeane added a comment. Response to Roman's comment. https://reviews.llvm.org/D39301 Files: lib/Sema/Sema.cpp test/SemaCXX/warn-zero-nullptr.cpp Index: lib/Sema/Sema.cpp =

[PATCH] D39301: Ignore implicity casts for zero-as-null-pointer-constant warning

2017-10-25 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: test/SemaCXX/warn-zero-nullptr.cpp:29 + +// Shouldn't warn. +struct pr34362 { operator int*() { return nullptr; } }; Maybe wrap into a `namespace PR34362 {}` https://reviews.llvm.org/D39301 __

[PATCH] D39301: Ignore implicity casts for zero-as-null-pointer-constant warning

2017-10-25 Thread Erich Keane via Phabricator via cfe-commits
erichkeane created this revision. The repro in https://bugs.llvm.org/show_bug.cgi?id=34362 caused the left nullptr to be cast to a int* implicitly, which resulted diagnosing this falsely. https://reviews.llvm.org/D39301 Files: lib/Sema/Sema.cpp test/SemaCXX/warn-zero-nullptr.cpp Index: li