Bug 425941 - Compilation error when renaming macro
Summary: Compilation error when renaming macro
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:24 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-16 17:24:03 EST
Eclipse IDE for C/C++ Developers
Version: Kepler Service Release 1
Build id: 20130919-0819


When attempting to rename a macro in an external file (header), the refactoring tool does not update references resulting in a compilation error.


Steps to reproduce the bug:

1. Create a header file named h1.h with the following code:
====================================
// file h1.h

#define MACRO1

#ifdef MACRO1
        int c = 20;
#endif
====================================
2. Create a C file with the following code:

====================================
#include <stdio.h>
#include "h1.h"

extern int c;

int main(){
    #ifdef MACRO2
        printf("%d", c);
    #endif
    printf("%d", 13); // output: 13
    return 0;
}
=====================================

3. Apply the Rename to the MACRO1 inside h1 to MACRO2, 

=====================================
#define MACRO2

#ifdef MACRO1 // Missing reference
    int c = 20;
#endif
=====================================


Thanks in advance