| Summary: | Macro use after for loop formats incorrectly | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Geoff Alexander <gdlxn> | ||||
| Component: | cdt-editor | Assignee: | Anton Leherbauer <aleherb+eclipse> | ||||
| Status: | RESOLVED FIXED | QA Contact: | Anton Leherbauer <aleherb+eclipse> | ||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | cdtdoug, gdlxn | ||||
| Version: | 8.0 | ||||||
| Target Milestone: | 8.0.2 | ||||||
| Hardware: | PC | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Created attachment 202726 [details]
Eclipse workspace containing small example illustrating the problem
Adding example
It's too late for 8.0.1, but I have a fix ready for 8.0.2. Fixed in master and cdt_8_0. *** cdt git genie on behalf of Anton Leherbauer ***
Bug 356690 - Macro use after for loop formats incorrectly
[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=01b24ceba436b57970ceac00c9b2c22c48bd52a3
*** cdt git genie on behalf of Anton Leherbauer ***
Bug 356690 - Macro use after for loop formats incorrectly
[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=d52d24ecbe5f5d05d220a93375f93933f9e77852
|
Build Identifier: 20110615-0604 I've attached an Eclipse workspace containing a small example illustrating the problem. In ExampleClassXXXXXX.cpp the nsxxxxxx::ExampleClassXXXXXX::add(const MyClassX& aa, const MyClassX& bb) method format incorrectly: bool nsxxxxxx::ExampleClassXXXXXX::add(const MyClassX& aa, const MyClassX& bb) { for (myIntXXXXXXXXXXXX_type i = 0; i < _bbbb; ++i) { const InnerClassXXXXXXXXXX & ccc = _ccc; if (ccc._aa == aa) { if (ccc._bb == bb) { return true; } else { return false; } } else if (ccc._bb == bb) { return false; } }NSXXXXXX_XXXXXXX(_bbbb < _aaaaaaaa); return true; } If should format as bool nsxxxxxx::ExampleClassXXXXXX::add(const MyClassX& aa, const MyClassX& bb) { for (myIntXXXXXXXXXXXX_type i = 0; i < _bbbb; ++i) { const InnerClassXXXXXXXXXX & ccc = _ccc; if (ccc._aa == aa) { if (ccc._bb == bb) { return true; } else { return false; } } else if (ccc._bb == bb) { return false; } } NSXXXXXX_XXXXXXX(_bbbb < _aaaaaaaa); return true; } Reproducible: Always Steps to Reproduce: See the example.