Bug 332257 - renaming a macro doesn't change its usage within another macro
Summary: renaming a macro doesn't change its usage within another macro
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-refactoring (show other bugs)
Version: 8.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-09 17:16 EST by Matt Hargett CLA
Modified: 2020-09-04 15:22 EDT (History)
2 users (show)

See Also:


Attachments
tarball of the source tree that reproduces this bug, from the open source project "cgreen" (244.91 KB, application/x-bzip)
2010-12-09 17:17 EST, Matt Hargett CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Hargett CLA 2010-12-09 17:16:30 EST
Build Identifier: 201012031515

For the following code from the open source project cgreen:

#define expect(f, ...) expect_(get_test_reporter(), #f, __FILE__, __LINE__, (Constraint *)__VA_ARGS__ +0, (Constraint *)0)

void expect_(TestReporter *test_reporter, const char *function, const char *test_file, int test_line, ...);

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

Ensure(single_item_breadcrumb_does_calls_walker_only_once) {
    expect(mock_walker, where(name, is_equal_to_string("Hello")));
}

Renaming the macro where() on the first line does not correctly update the name in the expect() statement on the next to last line.

Reproducible: Always

Steps to Reproduce:
1. unpack the attached tarball and add it to a new C++ project
2. opens mocks.h
3. select the where() macro delcaration and press alt+shift+R
4. change the name to when() and press Enter

result:
compilation will fail because the instances of where() in breadcrumb_tests.c and a few other places are not correctly renamed.

expected result:
rename refactoring should correctly update all instances of the symbol name so that compilation and behaviour of the code continues without a problem.
Comment 1 Matt Hargett CLA 2010-12-09 17:17:00 EST
Created attachment 184909 [details]
tarball of the source tree that reproduces this bug, from the open source project "cgreen"
Comment 2 Matt Hargett CLA 2010-12-09 17:18:43 EST
It's worth noting that if I go iunto breadcrumb_tests.c, and select the instance of when() that wasn't renamed correctly, and then press alt+shift+R, CDT *does* correctly rename all the instances in the file.
Comment 3 Matt Hargett CLA 2011-05-20 15:32:31 EDT
Verified this problem is still present in build ID  201105160958.
Comment 4 Matt Hargett CLA 2011-05-20 15:33:14 EDT
Verified this problem still exists in build id 201105160958.
Comment 5 Matt Hargett CLA 2013-02-20 17:14:09 EST
still happening in Version: 8.2.0.201302052218