]> granicus.if.org Git - clang/commit
Fix layout of blocks inside statements.
authorManuel Klimek <klimek@google.com>
Thu, 10 Jan 2013 11:52:21 +0000 (11:52 +0000)
committerManuel Klimek <klimek@google.com>
Thu, 10 Jan 2013 11:52:21 +0000 (11:52 +0000)
commitbb42bf1a8bfd18fa2beec7fcbcb73f738fb455ba
tree0764c85a4a442a13ef3caa2d3d3c818db37d0758
parent5cf7cf317f684dc61b8a0e4476440b5635b80db4
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
lib/Format/Format.cpp
lib/Format/UnwrappedLineParser.cpp
lib/Format/UnwrappedLineParser.h
unittests/Format/FormatTest.cpp