This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Fix a false positive in modernize-use-nullptr.
ClosedPublic

Authored by hokein on Jun 22 2017, 11:57 AM.

Details

Summary

The FP happens when a casting nullptr expression is used within a NULL-default-arguemnt cxx constructor.

Before the fix, the check will give a warning on nullptr when running
with the test case, which should not happen:

G(g(static_cast<char*>(nullptr)));
    ^~~~~~~~~~~
    nullptr

Event Timeline

hokein created this revision.Jun 22 2017, 11:57 AM
hokein added a subscriber: cfe-commits.
alexfh accepted this revision.Jun 23 2017, 1:52 AM

LG. Thank you for the fix!

This revision is now accepted and ready to land.Jun 23 2017, 1:52 AM
This revision was automatically updated to reflect the committed changes.