[clang-tools-extra] [clangd] DefineInline: only trigger on the declaration that has the body (PR #227534)

Aleksandr Platonov via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 29 23:47:46 PDT 2026


================
@@ -400,7 +400,7 @@ class DefineInline : public Tweak {
     if (!SelNode)
       return false;
     Source = getSelectedFunction(SelNode);
-    if (!Source || !Source->hasBody())
+    if (!Source || !Source->doesThisDeclarationHaveABody())
----------------
ArcsinX wrote:

It seems `doesThisDeclarationHaveABody()` can return `true` when there is no body, but  `isLateTemplateParsed()`is `true` https://github.com/llvm/llvm-project/blob/main/clang/include/clang/AST/Decl.h#L2442
So, maybe we still need `Source->hasBody()` check here.

https://github.com/llvm/llvm-project/pull/227534


More information about the cfe-commits mailing list