[PATCH] D147802: [clangd] Handle destructors in DefineOutline tweak

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 13 11:09:41 PDT 2023


njames93 added inline comments.


================
Comment at: clang-tools-extra/clangd/refactor/tweaks/DefineOutline.cpp:186-194
+  if (const auto *Destructor = llvm::dyn_cast<CXXDestructorDecl>(FD)) {
+    if (auto Err = DeclarationCleanups.add(tooling::Replacement(
+            SM, Destructor->getLocation(), 0,
+            getQualification(AST, *TargetContext,
+                             SM.getLocForStartOfFile(SM.getMainFileID()),
+                             Destructor))))
+      Errors = llvm::joinErrors(std::move(Errors), std::move(Err));
----------------
I had thought about adjusting the FindTarget code for this, but that resulted in a lot of other failed tests. It seems a delicate one there.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147802/new/

https://reviews.llvm.org/D147802



More information about the cfe-commits mailing list