Indentation of the last line was reset to the initial indentation of the block when reaching EOF.
Patch by Maxime Beaulieu
Differential Revision: http://reviews.llvm.org/D19065
llvm-svn: 266321
++Line->Level;
parseLevel(/*HasOpeningBrace=*/true);
+ if (eof())
+ return;
+
if (MacroBlock ? !FormatTok->is(TT_MacroBlockEnd)
: !FormatTok->is(tok::r_brace)) {
Line->Level = InitialLevel;
}
TEST_F(FormatTest, IndentLineCommentsInStartOfBlockAtEndOfFile) {
- // FIXME: This is not what we want...
verifyFormat("{\n"
- "// a"
- "// b");
+ " // a\n"
+ " // b");
}
TEST_F(FormatTest, FormatStarDependingOnContext) {