Community
Participate
Working Groups
In the following program... ========== typedef struct s { char *n; }st; int main() { st i; st *p; p = &i; p->n = "Jack"; // extract p printf("%s", p->n); return 0; } ========== ...if you select p (on line 10) and invoke the Extract Function refactoring, CDT produces the following incorrect code: ========== typedef struct s { char *n; }st; st extracted_function(st* p) { return p; } int main() { st i; st *p; p = &i; extracted_function(p)->n = "Jack"; printf("%s", p->n); return 0; } ========== The return type of the extracted function should be st*, not st.
New Gerrit change created: https://git.eclipse.org/r/119687