SureYeaah added a comment.
What was the bug in getCallExpr() ?
================
Comment at: clang-tools-extra/clangd/refactor/tweaks/ExtractVariable.cpp:391
+ return false;
+ Outer->dumpColor();
+ // Blacklist the most common places where an expr can appear but be unused.
----------------
Remove dump.
================
Comment at: clang-tools-extra/clangd/refactor/tweaks/ExtractVariable.cpp:445
+
+ // FIXME: ban extracting the RHS of an assignment: `a = [[foo()]]`
return true;
----------------
Check if parent is an assignment binaryoperator or a vardecl?
================
Comment at: clang-tools-extra/clangd/refactor/tweaks/ExtractVariable.cpp:461
+ // For function and member function DeclRefs, extract the whole call.
+ if (const DeclRefExpr *DeclRef = dyn_cast_or_null<DeclRefExpr>(SelectedExpr))
TargetNode = getCallExpr(N);
----------------
Can we combine both these IFs and remove the unused assignment?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D65337/new/
https://reviews.llvm.org/D65337
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits