This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 240303 - [refactoring-rename] Compilation error when renaming variable with existing macro name
Summary: [refactoring-rename] Compilation error when renaming variable with existing m...
Status: NEW
Alias: None
Product: cnd
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.0
Hardware: PC Mac OS X
: P3 normal (vote)
Assignee: Vladimir Voskresensky
URL:
Keywords:
: 240304 240437 240465 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-01-11 17:34 UTC by gugawag
Modified: 2014-02-11 13:06 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description gugawag 2014-01-11 17:34:57 UTC
Version: Netbeans 7.4


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;
#endif
    return a;
}
===============================================

Now, let's rename the selected variable to "A":
============= Refactored Version =============
#define A
int main(int argc, char** argv) {
    int A;
#ifdef A
    A = 1;
#endif
    return A;
}
===============================================

Notice that when the compiler attempts to expand the macro in "int A;", producing "int ;", therefore, a lexical error.


Thanks in advance.
Comment 1 gugawag 2014-01-11 18:09:00 UTC
* sorry, it's a syntax error, although the kind of compiling error is irrelevant.
Comment 2 Vladimir Voskresensky 2014-02-11 13:05:21 UTC
Thanks. We will implement it as an enhancement later on
Comment 3 Vladimir Voskresensky 2014-02-11 13:05:45 UTC
*** Bug 240304 has been marked as a duplicate of this bug. ***
Comment 4 Vladimir Voskresensky 2014-02-11 13:06:05 UTC
*** Bug 240437 has been marked as a duplicate of this bug. ***
Comment 5 Vladimir Voskresensky 2014-02-11 13:06:26 UTC
*** Bug 240465 has been marked as a duplicate of this bug. ***