Bug 425488 - Overly strong condition when attempting to rename a variable
Summary: Overly strong condition when attempting to rename a variable
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-01-11 12:47 EST by Gustavo Wagner CLA
Modified: 2020-09-04 15:17 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 Gustavo Wagner CLA 2014-01-11 12:47:58 EST
Version:
Eclipse IDE for C/C++ Developers
Version: Kepler Service Release 1
Build id: 20130919-0819


Reproducing the bug:


Consider the following code:
============== Original Version ===============
#define A
int main(int argc, char** argv) {
    int a; // Variable to be renamed
#ifdef A
    a = 1;
#else
    a = 2
#endif
    return a;
}
===============================================

Now, let's try to rename the selected variable to "b". Since there aren't any other declaration named "b", it should produce the following result:
============= Suggested Version ==============
#define A
int main(int argc, char** argv) {
    int b;
#ifdef A
    b = 1;
#else
    b = 2
#endif
    return b;
}
===============================================

However, the refactoring tool doesn't allow to apply the transformation (overly strong constraints).

Thanks in advance
Comment 1 Gustavo Wagner CLA 2014-01-13 20:59:37 EST
overly strong constraints = overly strong condition. Sorry me.
Comment 2 Gustavo Wagner CLA 2014-01-13 21:00:08 EST
overly strong constraints = overly strong condition. Sorry me.