Bug 425942 - Overly strong condition when attempting to rename a parameter
Summary: Overly strong condition when attempting to rename a parameter
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-16 17:52 EST by Gustavo Wagner CLA
Modified: 2020-09-04 15:21 EDT (History)
1 user (show)

See Also:


Attachments
Warning message (40.68 KB, image/tiff)
2014-01-16 17:52 EST, Gustavo Wagner CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gustavo Wagner CLA 2014-01-16 17:52:38 EST
Created attachment 239080 [details]
Warning message

Eclipse IDE for C/C++ Developers
Version: Kepler Service Release 1
Build id: 20130919-0819


The refactoring tool does not directly apply a parameter rename due to an overly strong condition.


Steps to reproduce the bug:

1. Consider the following code:
================== Original ==================
#define Id_0

void main_0(float aa_0){ // parameter to be renamed
  #ifdef Id_0
    aa_0 = 2;
  #else
    aa_0 = 0;
  #endif
  #ifdef Id_0
    aa_0 = 100;
  #endif
}
==============================================

2. Let's try to rename "aa_0" to "x":

================== Proposed Change ==================
#define Id_0

void main_0(float x){ // Proposed change
  #ifdef Id_0
    x = 2;
  #else
    x = 0;
  #endif
  #ifdef Id_0
    x = 100;
  #endif
}
====================================================

See attached the warning message.

Thanks in advance