| Summary: | Auto Indentation (CTRL+i) is not correct after function header with pointer return type | ||
|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Peter <peter.sandelin> |
| Component: | cdt-editor | Assignee: | Anton Leherbauer <aleherb+eclipse> |
| Status: | RESOLVED FIXED | QA Contact: | Anton Leherbauer <aleherb+eclipse> |
| Severity: | normal | ||
| Priority: | P3 | CC: | cdtdoug, filip.gustafsson |
| Version: | 7.0.1 | ||
| Target Milestone: | 7.0.2 | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
Build Identifier: M20100909-0800 When doing auto-indent (CTRL + i) it indents the braces of the function. But only if the function returns a pointer! That is has '*' in the function declaration. Remove '*' and it works. Example: const int * functionx(int xxx) const int * functionx(int xxx) {//NOT OK }//NOT OK const int functionx(int xxx) { //OK } //OK I notice that Auto Formatting ( CTRL+SHIFT+'f') indents correctly. Could be related to https://bugs.eclipse.org/bugs/show_bug.cgi?id=298282 Reproducible: Always Steps to Reproduce: 1. Choose project -> "Code Style" -> "K&R [built-in]" 2. Click "Edit" 2. Name it "K&R [built-in] Modified" 3. Tab "Braces" -> "Function Declaration" -> "Next Line" 4. Press "OK" 5. Write these functions in a file test.c ------------------- START ------ const int * functionx(int xxx) { //try auto indent on this function. CTRL + "i" return &xxx; } const int functionx(int xxx) { //try auto indent on this function. CTRL + "i" return xxx; } ------------------- END ------ 6. Mark them and auto format using CTRL + SHIFT + 'F'. 7. Now auto indent them using CTRL + 'i'. 8. The indentation of the first functions braces are indented (wrongly)! 9. Notice: Now auto indent them AGAIN using CTRL + 'i', they move one more time. 10. Notice; Mark them and then auto format them again fixes it (CTRL + SHIFT + 'F').