This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Fix an assertion violation in rename.
ClosedPublic

Authored by hokein on Dec 4 2020, 1:36 AM.

Details

Summary

NamedDecl::getName() asserts the name must be an identifier.

Diff Detail

Event Timeline

hokein created this revision.Dec 4 2020, 1:36 AM
hokein requested review of this revision.Dec 4 2020, 1:36 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 4 2020, 1:36 AM
sammccall accepted this revision.Dec 4 2020, 2:39 AM
sammccall added inline comments.
clang-tools-extra/clangd/unittests/RenameTests.cpp
949

This case seems a little *too* special: you might consider -(int) foo:(int)x; or so to make it clearer why this isn't an ordinary name.

I'd also make the comment a bit more specific: "Token is an identifier, but declaration name isn't a simple identifier".

This revision is now accepted and ready to land.Dec 4 2020, 2:39 AM
hokein updated this revision to Diff 309506.Dec 4 2020, 3:20 AM
hokein marked an inline comment as done.

address comment.

This revision was landed with ongoing or failed builds.Dec 4 2020, 3:23 AM
This revision was automatically updated to reflect the committed changes.