clang-format: Fix bad corner case in formatting of function types.
authorDaniel Jasper <djasper@google.com>
Mon, 24 Apr 2017 14:28:49 +0000 (14:28 +0000)
committerDaniel Jasper <djasper@google.com>
Mon, 24 Apr 2017 14:28:49 +0000 (14:28 +0000)
commitcab4617132b0342d1774ff71dcbd16fde2409bd4
treecab14e45a7235a47d84e223e9a2ea865de70a087
parent9111cd950d2ffb50a20e0c8680d24cb4bcc105ad
clang-format: Fix bad corner case in formatting of function types.

Before:
  std::function<
      LoooooooooooongTemplatedType<SomeType>*(
          LooooooooooooooooooooongType
              type)>
      function;

After:
  std::function<
      LoooooooooooongTemplatedType<
          SomeType>*(
          LooooooooooooooooongType type)>
      function;

clang-format generally avoids having lines like "SomeType>*(" as they
lead to parameter lists that don't belong together to be aligned. However, in
case it is better than the alternative, which can even be violating the column
limit.

llvm-svn: 301182
clang/lib/Format/ContinuationIndenter.cpp
clang/unittests/Format/FormatTest.cpp