This is an archive of the discontinued LLVM Phabricator instance.

Ignore implicity casts for zero-as-null-pointer-constant warning
ClosedPublic

Authored by erichkeane on Oct 25 2017, 11:18 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

erichkeane created this revision.Oct 25 2017, 11:18 AM
lebedev.ri added inline comments.Oct 25 2017, 11:22 AM
test/SemaCXX/warn-zero-nullptr.cpp
29 ↗(On Diff #120286)

Maybe wrap into a namespace PR34362 {}

erichkeane marked an inline comment as done.

Response to Roman's comment.

aaron.ballman added inline comments.Oct 25 2017, 11:32 AM
lib/Sema/Sema.cpp
441 ↗(On Diff #120288)

Do we also want to ignore parens here as well with Expr::IgnoreParenImpCasts()?

erichkeane added inline comments.Oct 25 2017, 11:40 AM
lib/Sema/Sema.cpp
441 ↗(On Diff #120288)

I don't see a reason why not! Patch incoming.

Lets ignore parens too!

lebedev.ri added inline comments.Oct 25 2017, 11:48 AM
lib/Sema/Sema.cpp
441 ↗(On Diff #120288)

Probably needs a test too :)

This revision is now accepted and ready to land.Oct 25 2017, 11:50 AM
thakis accepted this revision.Oct 25 2017, 11:51 AM

Awesome, thanks much! Like lebedev.ri says, adding a test for the "Parens" part would be good.

They've got me presenting in the next meeting, but i'll add said test and commit after. Thanks for the reviews guys!

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. ;-)

This revision was automatically updated to reflect the committed changes.