Fix layout of blocks inside statements.
Previously, we would not indent:
SOME_MACRO({
int i;
});
correctly. This is fixed by adding the trailing }); to the unwrapped
line starting with SOME_MACRO({, so the formatter can correctly match
the braces and indent accordingly.
Also fixes incorrect parsing of initializer lists, like:
int a[] = { 1 };
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172058 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Format/UnwrappedLineParser.h b/lib/Format/UnwrappedLineParser.h
index 16ad37e..017daf5 100644
--- a/lib/Format/UnwrappedLineParser.h
+++ b/lib/Format/UnwrappedLineParser.h
@@ -131,6 +131,7 @@
void parsePPUnknown();
void parseComments();
void parseStructuralElement();
+ void parseBracedList();
void parseParens();
void parseIfThenElse();
void parseForOrWhileLoop();
@@ -163,6 +164,8 @@
const FormatStyle &Style;
FormatTokenSource *Tokens;
UnwrappedLineConsumer &Callback;
+
+ friend class ScopedLineState;
};
} // end namespace format