[clang-tools-extra] [clangd] fix extract-to-function for overloaded operators (PR #81640)

Nathan Ridge via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 4 00:00:31 PST 2024


================
@@ -190,6 +190,14 @@ F (extracted();)
     }]]
   )cpp";
   EXPECT_EQ(apply(CompoundFailInput), "unavailable");
+
+  ExtraArgs.push_back("-std=c++14");
+  // FIXME: Expressions are currently not extracted
+  EXPECT_EQ(apply(R"cpp(
+                void sink(int);
+                void call() { sink([[1+1]]); }
----------------
HighCommander4 wrote:

I was thinking more specifically about entire expression-statements, e.g. `[[stream << 42;]]`.

Extraction of arbitrary subexpressions would be nice as well, but likely more involved; there is a work in progress [here](https://reviews.llvm.org/D140619).

(We can keep this test case too.)

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


More information about the cfe-commits mailing list