Details
-
Bug
-
Resolution: Fixed
-
P3: Somewhat important
-
Qt Creator 4.4.0-beta1, Qt Creator 4.5.0, Qt Creator 4.10.0-rc1
-
Ubuntu 16.04 64 bit
Windows 10 1709 64 bit
-
840263eb9a7687f2c0ecd9b0503d355fad5bac5e
Description
- Start Creator with enabled Clang Code Model.
- Have some simple lines of code:
int dummy = 0; if (dummy < 10) ++dummy;
- Select the "if".
- Right click into the editor and select "Refactor" -> "Extract Function" from the context menu.
- Enter a name for the function and click "OK".
The generated function will look like this:void functionName() { if (dummy < 10) ++dummy; }
This is syntactically incorrect because dummy is undeclared.
In Creator 4.3 this works correctly as well as with the built-in code model: They make the used variable an input parameter to the function.
Found and tested by Squish test tst_CSUP03.
Attachments
Issue Links
- is duplicated by
-
QTCREATORBUG-22788 Parameter detection in "Extract function" is fragile
-
- Closed
-
- Is tested by
-
QTCREATORBUG-19240 Make sure that libclang.dll is in bin or PATH for squish-windows_NextRelease
-
- Closed
-