Fix parsing of variable declarations directly after a class / struct.
Previous indent: class A { } a; void f() { }; With this patch: class A { } a; void f() { } ; The patch introduces a production for classes and structs, and parses the rest of the line to the semicolon after the class scope. This allowed us to remove a long-standing wart in the parser that would just much the semicolon after any block. Due to this suboptimal formating some tests were broken. Some unrelated formatting tests broke; those hit a bug in the ast printing, and need to be fixed separately. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171761 91177308-0d34-0410-b5e6-96231b3b80d8
Showing
- lib/Format/UnwrappedLineParser.cpp 25 additions, 4 deletionslib/Format/UnwrappedLineParser.cpp
- lib/Format/UnwrappedLineParser.h 1 addition, 0 deletionslib/Format/UnwrappedLineParser.h
- test/Index/comment-cplus-decls.cpp 1 addition, 1 deletiontest/Index/comment-cplus-decls.cpp
- test/Index/comment-to-html-xml-conversion.cpp 1 addition, 1 deletiontest/Index/comment-to-html-xml-conversion.cpp
- unittests/Format/FormatTest.cpp 14 additions, 7 deletionsunittests/Format/FormatTest.cpp
Please register or sign in to comment