Bug 435121 - Compilation error when extracting a local variable using a name with blank spaces
Summary: Compilation error when extracting a local variable using a name with blank sp...
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-refactoring (show other bugs)
Version: Next   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-17 11:17 EDT by Melina Mongiovi CLA
Modified: 2020-09-04 15:24 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 Melina Mongiovi CLA 2014-05-17 11:17:19 EDT
Eclipse IDE for C/C++ Developers


Reproducing the bug:


Consider the following code:
======== Original Version ========

#define Id_0
float func_0 ( ){
	float LocalVar_0 = 2;
return LocalVar_0;
}
float Function_0 (  int LocalVar_1){

float LocalVar_0 = 2;
return LocalVar_0;
}

After applying the refactoring, we have the resulting code:

#define Id_0
float func_0 ( ){
	int a
	v = 10;
	float LocalVar_0 = a
	v;
return LocalVar_0;
}
float Function_0 (  int LocalVar_1){

float LocalVar_0 = 2;
return LocalVar_0;
}
Comment 1 Melina Mongiovi CLA 2014-05-17 11:20:10 EDT
Please, Consider these codes instead of the other one:

Consider the following code:
======== Original Version ========

#define Id_0
float func_0 ( ){
	float LocalVar_0 = 10;
return LocalVar_0;
}
float Function_0 (  int LocalVar_1){

float LocalVar_0 = 2;
return LocalVar_0;
}

After applying the refactoring, we have the resulting code:

#define Id_0
float func_0 ( ){
	int a
	v = 10;
	float LocalVar_0 = a
	v;
return LocalVar_0;
}
float Function_0 (  int LocalVar_1){

float LocalVar_0 = 2;
return LocalVar_0;
}