]> granicus.if.org Git - clang/commit
clang-format: Keep more trailing annotations on the same line.
authorDaniel Jasper <djasper@google.com>
Wed, 9 Apr 2014 10:01:49 +0000 (10:01 +0000)
committerDaniel Jasper <djasper@google.com>
Wed, 9 Apr 2014 10:01:49 +0000 (10:01 +0000)
commit4d9a6735c124dc1812288bc2eec82cc00048d5b0
treedeb3f8b1418860953b969e28086b4dacfe628bda
parentbfa38f08f23a8984887fda3e14bfa7660a14decd
clang-format: Keep more trailing annotations on the same line.

More precisely keep all short annotations (<10 characters) on the same
line if possible. Previously, clang-format would only prefer to do so
for "const", "override" and "final". However, it seems to be generally
preferable, especially because some codebases have to wrap those in
macros for backwards compatibility.

Before:
  void someLongFunction(int someLongParameter)
      OVERRIDE {}

After:
  void someLongFunction(
      int someLongParameter) OVERRIDE {}

This fixes llvm.org/PR19363.

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