[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:47 PDT 2026


================
@@ -48,6 +48,14 @@ TEST_F(DefineInlineTest, TriggersOnFunctionDecl) {
   // Definition with no body.
   class Bar { Bar() = def^ault; };
   )cpp");
+
+  EXPECT_UNAVAILABLE(R"cpp(
+  // Redeclaration after the definition.
+  void foo() {
+    return;
+  }
+  vo^id f^oo();
----------------
ArcsinX wrote:

Do we really need to check the point inside `void`? I guess this was already unavailable before your patch.

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


More information about the cfe-commits mailing list