[clang-tools-extra] [clangd] Offer Extract to Function for single expression-statements (PR #219945)

Christian Kandeler via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 11 05:27:41 PDT 2026


================
@@ -298,11 +314,6 @@ computeEnclosingFuncRange(const FunctionDecl *EnclosingFunction,
 // returns true if Child can be a single RootStmt being extracted from
 // EnclosingFunc.
 bool validSingleChild(const Node *Child, const FunctionDecl *EnclosingFunc) {
-  // Don't extract expressions.
-  // FIXME: We should extract expressions that are "statements" i.e. not
-  // subexpressions
-  if (Child->ASTNode.get<Expr>())
----------------
ckandeler wrote:

Done.

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


More information about the cfe-commits mailing list