[PATCH] D69266: [clangd] Define out-of-line availability checks

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 24 01:58:08 PDT 2019


hokein added inline comments.


================
Comment at: clang-tools-extra/clangd/refactor/tweaks/DefineOutline.cpp:77
+    Source = getSelectedFunction(Sel.ASTSelection.commonAncestor());
+    if (!Source || !Source->isThisDeclarationADefinition())
+      return false;
----------------
I think `doesThisDeclarationHaveABody` is probably a better choice here? `isThisDeclarationADefinition` returns true for defaulted methods like `void Ctor() = default;`, we'd need to disable the tweak for this case, could you add a test case for this?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D69266





More information about the cfe-commits mailing list