[clang-tools-extra] [clangd] Do not offer extraction to variable for decl init expression (PR #69477)

Christian Kandeler via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 11 02:45:37 PST 2024


================
@@ -27,10 +27,10 @@ TEST_F(ExtractVariableTest, Test) {
       return [[[[t.b[[a]]r]]([[t.z]])]];
     }
     void f() {
-      int a = [[5 +]] [[4 * [[[[xyz]]()]]]];
+      int a = 5 + [[4 * [[[[xyz]]()]]]];
       // multivariable initialization
       if(1)
-        int x = [[1]], y = [[a + 1]], a = [[1]], z = a + 1;
+        int x = [[1]] + 1, y = [[a + 1]], a = [[1]] + 2, z = a + 1;
----------------
ckandeler wrote:

Yes, I got side-tracked by fixing all the regressions, and in the end the patch didn't fulfill its original purpose anymore.
Fixed  now.

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


More information about the cfe-commits mailing list