This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Add modernize-make-shared check
ClosedPublic

Authored by Prazek on Apr 15 2016, 3:45 PM.

Details

Reviewers
hokein
Summary

Because modernize-make-shared do almos the same job,

I refactored common code to MakeSmartPtrCheck.

Diff Detail

Event Timeline

Prazek updated this revision to Diff 53965.Apr 15 2016, 3:45 PM
Prazek retitled this revision from to [clang-tidy] Add modernize-make-shared check.
Prazek updated this object.
Prazek added a subscriber: cfe-commits.
Prazek set the repository for this revision to rL LLVM.Apr 19 2016, 2:35 AM

ping

hokein edited edge metadata.Apr 24 2016, 11:34 AM

The patch looks almost good, some nits.

clang-tidy/modernize/MakeSmartPtrCheck.cpp
2

Extra blank line.

28

Remove two extra blanks.

test/clang-tidy/modernize-make-shared.cpp
82

Why can't this case convert to std::shared_ptr<int> R = std::make_shared<int>(new int())?

Prazek added inline comments.Apr 24 2016, 2:25 PM
test/clang-tidy/modernize-make-shared.cpp
82

You mean std::shared_ptr<int> R = std::make_shared<int>()?

hokein added inline comments.Apr 25 2016, 9:03 AM
test/clang-tidy/modernize-make-shared.cpp
82

Sorry, I misunderstood this statement before. Just Ignore the comment.

Prazek marked 3 inline comments as done.Apr 27 2016, 12:24 PM
Prazek updated this revision to Diff 55295.Apr 27 2016, 12:42 PM
Prazek edited edge metadata.
Prazek removed rL LLVM as the repository for this revision.
Prazek added a subscriber: alexfh.Apr 29 2016, 8:05 AM

ping.
@alexfh are you planning to take a look?

hokein accepted this revision.May 2 2016, 12:50 AM
hokein edited edge metadata.

LGTM.

This revision is now accepted and ready to land.May 2 2016, 12:50 AM
Prazek closed this revision.May 2 2016, 12:20 PM
Prazek marked 2 inline comments as done.