| Summary: | field in anonymous union inside structure is not renamed. | ||
|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Konstantin Stupnik <konstantin.stupnik> |
| Component: | cdt-refactoring | Assignee: | Markus Schorn <mschorn.eclipse> |
| Status: | RESOLVED FIXED | QA Contact: | Emanuel Graf <emanuel> |
| Severity: | normal | ||
| Priority: | P3 | CC: | cdtdoug |
| Version: | 7.0.1 | ||
| Target Milestone: | 8.0.2 | ||
| Hardware: | PC | ||
| OS: | Mac OS X - Carbon (unsup.) | ||
| Whiteboard: | |||
Added fix. *** cdt git genie on behalf of Markus Schorn ***
Bug 356272: Renaming fields of anonymous structs.
[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=ec625862b2d31651e2144698615572724dad180e
Thanks a lot Markus. While you are on it. In the same situation if field is used inside of macro, attempt to rename it makes nothing. structure and macro must be in header, field reference on which rename attempt is invoked is in .cpp file. Errors log contains error like this: org.eclipse.jface.text.BadLocationException: First position: 'u1' at 1106, this position: 'MACRO(t)' at 1092 macro is: #define MACRO(n) n.u1=1 Should I create separate bug for this? (In reply to comment #3) > Thanks a lot Markus. > While you are on it. > In the same situation if field is used inside of macro, attempt to rename it > makes nothing. > structure and macro must be in header, field reference on which rename attempt > is invoked is in .cpp file. > Errors log contains error like this: > org.eclipse.jface.text.BadLocationException: First position: 'u1' at 1106, this > position: 'MACRO(t)' at 1092 > macro is: > #define MACRO(n) n.u1=1 > Should I create separate bug for this? yes, please do so. *** cdt git genie on behalf of Markus Schorn ***
Bug 356272: Renaming fields of anonymous structs.
[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=ac6a9d985265a58344f003c3b32b8921d6e39fdf
|
Build Identifier: 20110615-0604 if there is structure like this: struct test_struct{ int a; union{ int u1; int u2; }; }; in the header file, and function like this: void test() { test_struct t; t.u1=1; } in .cpp file, then renaming of field u1 in headers doesn't rename it in .cpp file, and renaming it in .cpp file doesn't rename it in header. If both structure definition and function are in the same file, both are renamed. Reproducible: Always Steps to Reproduce: 1. put structure shown above in header 2. put function shown above in .cpp file that includes mentioned header. 3. try to use Refactor->Rename u1 in either header or .cpp file.