This is an archive of the discontinued LLVM Phabricator instance.

[clang-rename] Add the USR of incomplete decl to the USRSet.
ClosedPublic

Authored by hokein on Feb 19 2020, 5:43 AM.

Details

Summary

This fixes a clangd rename issue, which is missing the reference of
an incomplete specialization.

Unfortunately, I didn't reproduce this issue in clang-rename, I guess
the input FoundDecl of AdditionalUSRFinder is different in clangd vs
clang-rename, clang-rename uses the underlying CXXRecordDecl of the
ClassTemplateDecl, which is fixed in https://github.com/llvm/llvm-project/commit/5d862c042b52ae2aad37471d0b83b6c678a520e3;
while clangd-rename uses the ClassTemplateDecl.

Diff Detail

Event Timeline

hokein created this revision.Feb 19 2020, 5:43 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 19 2020, 5:43 AM
kbobyrev accepted this revision.EditedFeb 20 2020, 12:42 AM

Let me try to reproduce it in Clang-Rename. If I don't respond by tomorrow, feel free to submit the patch.

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

Nit: const auto *Definition and RecordDecl could stay the same.

This revision is now accepted and ready to land.Feb 20 2020, 12:42 AM

Yeah, it works in Clang-Rename due to additional steps in the renaming process. Testing only Clangd's rename is sufficient here.

This revision was automatically updated to reflect the committed changes.