Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 344077

Summary: Toggle Function: different or missing function parameter names will break code
Product: [Tools] CDT Reporter: Emanuel Graf <emanuel>
Component: cdt-refactoringAssignee: Emanuel Graf <emanuel>
Status: RESOLVED FIXED QA Contact: Emanuel Graf <emanuel>
Severity: normal    
Priority: P3 CC: cdtdoug
Version: 8.0   
Target Milestone: 8.0   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Emanuel Graf CLA 2011-04-28 02:44:29 EDT
The following code pieces will break compilation after toggle-refactoring:

Case one: differing parameter names

Header file:
struct myClass {
  int fVal;
  myClass(int headername);
};

Implementation file with different parameter name, implname instead of headername:
myClass::myClass(int implname) : fVal(implname) {}

Result in header file after toggling, parameter name of header file is not adjusted:
struct myClass {
  int fVal;
  myClass(int headername) : fVal(implname) {}
};


Case two: missing parameter name

Header file, parameter name left off:
struct myClass {
  int fVal;
  myClass(int);
};

Implementation file with parameter name set to implname:
myClass::myClass(int implname) : fVal(implname) {}

Result in header file after toggling, missing name of parameter does not get set:
struct myClass {
  int fVal;
  myClass(int) : fVal(implname) {}
};
Comment 1 Emanuel Graf CLA 2011-04-28 03:23:10 EDT
Fixed in HEAD > 20110428