Bug 435131 - Extract constant refactoring allows to define a constant with the same name as an existing define
Summary: Extract constant refactoring allows to define a constant with the same name a...
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 12:39 EDT by Melina Mongiovi CLA
Modified: 2020-09-04 15:19 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 12:39:33 EDT
Eclipse IDE for C/C++ Developers


Reproducing the bug:


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

#define Id_0
#define Id_1

int func_0(int LocalVar_1) {

	float LocalVar_0 = 10;
return LocalVar_1;
}
void Function_0 (  int LocalVar_1){

}

After applying the refactoring, we have the resulting code:

#define Id_0
#define Id_1
static const int Id_0 = 10;

int func_0(int LocalVar_1) {

	float LocalVar_0 = Id_0;
return LocalVar_1;
}
void Function_0 (  int LocalVar_1){

}