Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 344077 - Toggle Function: different or missing function parameter names will break code
Summary: Toggle Function: different or missing function parameter names will break code
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-refactoring (show other bugs)
Version: 8.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 8.0   Edit
Assignee: Emanuel Graf CLA
QA Contact: Emanuel Graf CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-28 02:44 EDT by Emanuel Graf CLA
Modified: 2011-04-28 09:23 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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