]> granicus.if.org Git - clang/commit
Fixes layout of right braces.
authorManuel Klimek <klimek@google.com>
Thu, 10 Jan 2013 15:58:26 +0000 (15:58 +0000)
committerManuel Klimek <klimek@google.com>
Thu, 10 Jan 2013 15:58:26 +0000 (15:58 +0000)
commitc8c8a478639f1474f4c53d12befc405934083633
tree9e42dac1e0f58717065b29cfc9672d029603d553
parent3048aeae0654b34dcae561494c1b28872c88a5c8
Fixes layout of right braces.

We now decide whether a newline should go before the closing brace
depending on whether a newline was inserted after the opening brace.

For example, we now insert a newline before '};' in:
static SomeClass WithALoooooooooooooooooooongName = {
  100000000, \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"
};
... while not inserting a newline here:
static SomeClass = { a, b, c, d, e, f, g, h, i, j,
                     looooooooooooooooooooooooooooooooooongname,
                     looooooooooooooooooooooooooooooong };

Also fixes the formating of (column limit 25):
int x = {
  avariable,
  b(alongervariable)
};

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172076 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Format/Format.cpp
unittests/Format/FormatTest.cpp