This is an archive of the discontinued LLVM Phabricator instance.

Fix bug in modernize-use-nullptr.
ClosedPublic

Authored by angelgarcia on Sep 29 2015, 7:29 AM.

Details

Summary

https://llvm.org/bugs/show_bug.cgi?id=24960

modernize-use-nullptr would hit an assertion in some cases involving macros and initializer lists, due to finding a node with more than one parent (the two forms of the initializer list).

However, this doesn't mean that the replacement is incorrect, so instead of just rejecting this case I tried to find a way to make it work. Looking at the semantic form of the InitListExpr made sense to me (looking at both forms results in false negatives) but I am not sure of the things that we can miss by skipping the syntactic form.

Diff Detail

Event Timeline

angelgarcia retitled this revision from to Fix bug in modernize-use-nullptr..
angelgarcia updated this object.
angelgarcia added a reviewer: klimek.
angelgarcia added subscribers: alexfh, cfe-commits.
angelgarcia updated this revision to Diff 36359.Oct 2 2015, 6:35 AM

Update this patch to the change in RecursiveASTVisitor.

klimek accepted this revision.Oct 2 2015, 8:55 AM
klimek edited edge metadata.

lg

This revision is now accepted and ready to land.Oct 2 2015, 8:55 AM
angelgarcia closed this revision.Oct 5 2015, 1:41 AM