Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 332256

Summary: renaming a function doesn't change that function's name in a macro definition
Product: [Tools] CDT Reporter: Matt Hargett <matt>
Component: cdt-refactoringAssignee: Project Inbox <cdt-refactoring-inbox>
Status: RESOLVED WORKSFORME QA Contact: Sergey Prigogin <eclipse.sprigogin>
Severity: normal    
Priority: P3 CC: cdtdoug, Jesse.Weinstein, malaperle, yevshif
Version: 8.0   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
tarball of the source tree that reprocued this bug, from the open source project "cgreen"
none
Minimal project to verify the problem none

Description Matt Hargett CLA 2010-12-09 17:06:41 EST
Build Identifier: 201012031515

For this code:

#define where(parameter, constraint) where_(#parameter, constraint)
Constraint *where_(const char *parameter, Constraint *constraint);

Renaming where_() doesn't change the usage of where_() in the macro definition. (It's also worth mentioning that I can't even rename where_() inside the macro definition, but that's a different bug.)



Reproducible: Always

Steps to Reproduce:
-unpack the attached source tarball
-add the directory to a C++ project
-open the file mocks.h
-select the where_ on the second line
-press alt+shift+R
-change name to when_, and press Enter

result:
it doesn't rename the instance of where_ in the macro definition on the first line

expected result:
should rename instances of that function name in macro definitions, as well as elsewhere.
Comment 1 Matt Hargett CLA 2010-12-09 17:08:11 EST
Created attachment 184908 [details]
tarball of the source tree that reprocued this bug, from the open source project "cgreen"
Comment 2 Jesse Weinstein CLA 2013-04-23 16:25:07 EDT
Created attachment 230050 [details]
Minimal project to verify the problem

On eclipse-SDK-4.3M5a-win32-x86_64

With this minimal test case: 

#define test(a,b) foo(#a, b)
void foo(const char *s,int b) {}

Running the Rename refactoring from the dialog box, with the "Macro definitions" checkbox checked, it works (i.e. I am unable to reproduce the bug).

I suggest this be closed as FIXED (or WORKSFORME).
Comment 3 Sergey Prigogin CLA 2013-04-23 20:51:01 EDT
Matt, please reopen if you can reproduce the problem with "Macro definitions" checkbox checked.