[PATCH] D67607: [clangd] Fix a crash when renaming operator.
Ilya Biryukov via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 16 02:01:50 PDT 2019
ilya-biryukov added a comment.
LGTM to fix the crash. See the comment about more cases that could potentially break, though. Do we handle them gracefully now?
================
Comment at: clang-tools-extra/clangd/refactor/Rename.cpp:77
return ReasonToReject::UnsupportedSymbol;
+ if (const auto *FD = llvm::dyn_cast<FunctionDecl>(&RenameDecl)) {
+ if (FD->isOverloadedOperator())
----------------
Should we more generally disable renaming all non-identifier names? Each of them seems to require special treatment.
A few examples that come to mind:
- conversion operators, e.g. `operator int()`;
- user-defined literals, e.g. `std::chrono::seconds operator ""s(int seconds)`;
- destructors;
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D67607/new/
https://reviews.llvm.org/D67607
More information about the cfe-commits
mailing list