Page MenuHomePhabricator

[clang-tidy] Fix type names in modernize-use-unique/shared_ptr checks.
ClosedPublic

Authored by hokein on Jun 16 2017, 11:13 AM.

Details

Summary

If the class being created in unique_ptr is in anonymous nampespace, the
anonymous namespace will be included in the apply-fixes. This patch fix
this.

namespace {
class Foo {};
}
std::unique_ptr<Foo> f;
f.reset(new Foo());
// Before the change: f = std::make_unique<(annonymous namespace)::Foo>();
// After the change: f = std::make_unique<Foo>();

Diff Detail

Repository
rL LLVM

Event Timeline

hokein created this revision.Jun 16 2017, 11:13 AM
alexfh accepted this revision.Jun 26 2017, 8:48 AM

LG

clang-tidy/modernize/MakeSmartPtrCheck.cpp
23 ↗(On Diff #102871)

s/clang:://

24 ↗(On Diff #102871)

ditto

This revision is now accepted and ready to land.Jun 26 2017, 8:48 AM
hokein updated this revision to Diff 103995.Jun 26 2017, 11:01 AM
hokein marked 2 inline comments as done.

Address review comments.

This revision was automatically updated to reflect the committed changes.