Community
Participate
Working Groups
Build Identifier: 201009141542 Say you have double right angle brackets (because of a nested template declaration) and then you add a double-slashed comment. If you try auto formatting the source file, an indentation is added to all lines below the comment. Reproducible: Always Steps to Reproduce: 1. Declare a nested template variable, e.g., std::vector<std::vector<int>> test 2. Add a comment somewhere below previous declaration in step 1 3. Try auto formatting with Ctrl+Shift+F
Created attachment 186344 [details] Example file for testing The attachment is an example of a file that will be mangled by auto formatting in CDT. Maybe some other test cases may be needed as well, like what happens if you have many of those nested-template declarations.
Fixed in HEAD and cdt_7_0.
*** cdt cvs genie on behalf of aleherbau *** Bug 333816 - [c++0x] Double right angle brackets formatting breaks indentation when mixed with comments [*] CodeFormatterVisitor.java 1.78.2.7 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java?root=Tools_Project&r1=1.78.2.6&r2=1.78.2.7 [*] CodeFormatterTest.java 1.54.2.6 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CodeFormatterTest.java?root=Tools_Project&r1=1.54.2.5&r2=1.54.2.6 [*] CodeFormatterTest.java 1.64 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt-core/org.eclipse.cdt.ui.tests/ui/org/eclipse/cdt/ui/tests/text/CodeFormatterTest.java?root=Tools_Project&r1=1.63&r2=1.64 [*] CodeFormatterVisitor.java 1.87 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt-core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/formatter/CodeFormatterVisitor.java?root=Tools_Project&r1=1.86&r2=1.87
*** Bug 334606 has been marked as a duplicate of this bug. ***