Community
Participate
Working Groups
In the following program... ========== int main(){ void* a; int b; if (a!= 0) //extract 0 b=0; return 0; } ========== ...if you select 0 (on line 4) and invoke the Extract Function refactoring, CDT produces the following code: ========== int extracted_function() { return 0; } int main() { void* a; int b; if (a != extracted_function()) b=0; return 0; } ========== After the refactoring there would be a comparison between pointer and integer. So, I would expect that this would be disallowed, or it would extract a function that returns a pointer, as follows: ========== int* extracted_function() { return 0; } int main() { void* a; int b; if (a != extracted_function()) b=0; return 0; } ==========