This is an archive of the discontinued LLVM Phabricator instance.

[clang-rename] Fix the missing template constructors.
ClosedPublic

Authored by hokein on Feb 7 2020, 5:32 AM.

Details

Summary

When renaming a class with template constructors, we are missing the
occurrences of the template constructors, because getUSRsForDeclaration doesn't
give USRs of the templated constructors (they are not in the normal ctors()
method).

Diff Detail

Event Timeline

hokein created this revision.Feb 7 2020, 5:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 7 2020, 5:32 AM
kbobyrev added inline comments.Feb 10 2020, 5:42 AM
clang-tools-extra/clangd/unittests/RenameTests.cpp
144

nit: Maybe also add ^ to this one and the one below?

clang/lib/Tooling/Refactoring/Rename/USRFindingAction.cpp
140

nit: The naming is slightly confusing, this probably suggests MethodDecl instance, but it's not spelled anywhere and may be better to call it just D.

clang/test/clang-rename/TemplateCtor.cpp
1 ↗(On Diff #243147)

Nit: not sure if the new file is necessary, maybe just put this under .../Ctor.cpp?

hokein updated this revision to Diff 243752.Feb 11 2020, 12:13 AM
hokein marked 3 inline comments as done.

address comments.

kbobyrev accepted this revision.Feb 11 2020, 12:28 AM

Should be good to go, please run git-clang-format on the changes just to make sure.

Thanks for fixing this!

clang-tools-extra/clangd/unittests/RenameTests.cpp
141

nit: I think this is still not formatted as the comment has a different offset.

This revision is now accepted and ready to land.Feb 11 2020, 12:28 AM
hokein updated this revision to Diff 243753.Feb 11 2020, 12:41 AM
hokein marked an inline comment as done.

Fix the format.

This revision was automatically updated to reflect the committed changes.