summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2014-04-09 10:01:49 +0000
committerDaniel Jasper <djasper@google.com>2014-04-09 10:01:49 +0000
commitb48d3afcd53e16712f55836a81f08a1d65953540 (patch)
tree3e7bdd2184d687554440a698e4f17cb82b646c1f /clang/unittests/Format/FormatTest.cpp
parentb282f1fec5ec87bdf8c3265061c77dd4c6fac78c (diff)
downloadbcm5719-llvm-b48d3afcd53e16712f55836a81f08a1d65953540.tar.gz
bcm5719-llvm-b48d3afcd53e16712f55836a81f08a1d65953540.zip
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. llvm-svn: 205845
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 5adc0d5725b..e3da016663c 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -3270,9 +3270,15 @@ TEST_F(FormatTest, BreaksFunctionDeclarationsWithTrailingTokens) {
" int someLongParameter) override {}",
Style);
verifyFormat("void someLongFunction(\n"
+ " int someLongParameter) OVERRIDE {}",
+ Style);
+ verifyFormat("void someLongFunction(\n"
" int someLongParameter) final {}",
Style);
verifyFormat("void someLongFunction(\n"
+ " int someLongParameter) FINAL {}",
+ Style);
+ verifyFormat("void someLongFunction(\n"
" int parameter) const override {}",
Style);
OpenPOWER on IntegriCloud