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

kadir çetinkaya via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 4 01:19:20 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;
----------------
kadircet wrote:

hmm, it's surprising that this is still available for `y = [[a + 1]]`

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


More information about the cfe-commits mailing list