HighCommander4 wrote:

@ckandeler Could you elaborate on the motivation for this change?

In my mind, the value proposition of the "extract variable" refactoring is that 
it saves you the work of moving the expression from one location to another, 
and typing the name of the variable twice (once at the declaration and once at 
the use).

In the expression-statement case, the expression isn't moving to a new 
location, and the variable name is only mentioned in one place. In essence, the 
refactoring amounts to prepending `auto placeholder = ` to the expression. 
Given that you're going to be (very likely) renaming `placeholder` anyways, 
does this really add anything meaningful over just typing `auto 
VariableNameYouWant = ` "manually"?

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

Reply via email to