summaryrefslogtreecommitdiffstats
path: root/clang/unittests
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2014-08-25 08:48:17 +0000
committerDaniel Jasper <djasper@google.com>2014-08-25 08:48:17 +0000
commit7189fb2cf9c4aed01b0061756615ae5c0041d044 (patch)
tree15047f31244b60094c93ef8098032e982d854dd4 /clang/unittests
parentc90308bf830bb9f26157e7850c4a6b261a0cd2ff (diff)
downloadbcm5719-llvm-7189fb2cf9c4aed01b0061756615ae5c0041d044.tar.gz
bcm5719-llvm-7189fb2cf9c4aed01b0061756615ae5c0041d044.zip
clang-format: Improve formatting of nested builder-type calls.
Before: f(FirstToken->WhitespaceRange.getBegin().getLocWithOffset( First->LastNewlineOffset)); After: f(FirstToken->WhitespaceRange.getBegin() .getLocWithOffset(First->LastNewlineOffset)); llvm-svn: 216377
Diffstat (limited to 'clang/unittests')
-rw-r--r--clang/unittests/Format/FormatTest.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 73d17d39106..70b02ebc801 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -3765,9 +3765,12 @@ TEST_F(FormatTest, FormatsBuilderPattern) {
" .aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<\n"
" aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa>();");
- // Prefer not to break after empty parentheses.
+ // Prefer not to break after empty parentheses ...
verifyFormat("FirstToken->WhitespaceRange.getBegin().getLocWithOffset(\n"
" First->LastNewlineOffset);");
+ // ... unless nested.
+ verifyFormat("f(FirstToken->WhitespaceRange.getBegin()\n"
+ " .getLocWithOffset(First->LastNewlineOffset));");
}
TEST_F(FormatTest, BreaksAccordingToOperatorPrecedence) {
OpenPOWER on IntegriCloud