-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
Qt Creator 3.2.2, Qt Creator 4.12.0-beta2
-
840263eb9a (qt-creator/qt-creator/master)
Check the attached code snippet.
After the "Extract Method" the a parameter is input only and a = b has no effect on the calling function a variable.
main.cpp
int testFunction() { int a = 0; // SELECTION START for Extract method int b = 0; for( int i= 0; i< 5; ++i) { b=i; if(i == 2) a = b; } // SELECTION END for Extract Method return a; }
main_after_extract_method.cpp
// RESULT FROM EXTRACT METHOD int testFunction() { int a = 0; foo(a); return a; } // a is input only parameter -> a = b has no effect on the calling function a variable void foo(int a) { int b = 0; for( int i= 0; i< 5; ++i) { b=i; if(i == 2) a = b; } }
- is duplicated by
-
QTCREATORBUG-6964 Extract function needs to be smarter for parameter arguments
-
- Closed
-
-
QTCREATORBUG-12238 Refactoring C++: Creator should automatically determine whether it's necessary to use a ref or not
-
- Closed
-