Details
-
Bug
-
Resolution: Won't Do
-
P2: Important
-
None
-
Qt Creator 8.0.0-rc1
-
Ubuntu 20.04 LTS
Windows 10 21H2
Description
- Have a trivial line in a source file:
int i = 1 + 2 + 3 + 4;
- Select the first half of the sum, e.g. the first two summands and the plus sign.
- Press Alt+Enter and select "clang: Extract subexpression to variable" from the popup menu.
Works as expected:auto placeholder = 1 + 2; int i = placeholder + 3 + 4;
- Select the second half of the sum, e.g. the last two summands and their plus sign.
- Press Alt+Enter and select "clang: Extract subexpression to variable" from the popup menu.
This reuses the same variable name creating a compile error:auto placeholder = 1 + 2; auto placeholder = 3 + 4; int i = placeholder + placeholder;
This should use distinct variable names.