================
@@ -490,6 +491,13 @@ bool eligibleForExtraction(const SelectionTree::Node *N) {
         BO->getRHS() == OuterImplicit.ASTNode.get<Expr>())
       return false;
   }
+  if (const auto *Decl = Parent->ASTNode.get<VarDecl>()) {
+    if (!Decl->isInitCapture() &&
----------------
ckandeler wrote:

Presumably, with the BinOp check I intended to prevent a false negative for 
this case:
`int x = 1 + 2 + [[3 + 4 + 5]];`
Apparently, the parser considers the last "+" to be the top-level expression, 
so we would erroneously fail to offer extraction for the above expression.
However, the same problem already existed for the assignment case, so it's 
probably wrong anyway to add such a workaround for initialization only. On the 
other hand, I don't want to introduce a regression either. Do you have a good 
idea as to how a proper check could look like?


https://github.com/llvm/llvm-project/pull/69477
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to