summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTestObjC.cpp
diff options
context:
space:
mode:
authorKrasimir Georgiev <krasimir@google.com>2018-05-14 10:33:40 +0000
committerKrasimir Georgiev <krasimir@google.com>2018-05-14 10:33:40 +0000
commit964293e46d72a07a53f91e3ee7e5fd528cf036cf (patch)
tree5d5957528ca9b7fc5cbcb290a9fbc8107c816f1b /clang/unittests/Format/FormatTestObjC.cpp
parent796fb999b358f9d060946f8a54e0cc7501ec3f61 (diff)
downloadbcm5719-llvm-964293e46d72a07a53f91e3ee7e5fd528cf036cf.tar.gz
bcm5719-llvm-964293e46d72a07a53f91e3ee7e5fd528cf036cf.zip
[clang-format] Continue after non-scope-closers in getLengthToMatchingParen
Summary: This fixes a regression introduced by `r331857` where we stop the search for the End token as soon as we hit a non-scope-closer, which prematurely stops before semicolons for example, which should otherwise be considered as part of the unbreakable tail. Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D46824 llvm-svn: 332225
Diffstat (limited to 'clang/unittests/Format/FormatTestObjC.cpp')
-rw-r--r--clang/unittests/Format/FormatTestObjC.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestObjC.cpp b/clang/unittests/Format/FormatTestObjC.cpp
index c6246fd5025..459e522308a 100644
--- a/clang/unittests/Format/FormatTestObjC.cpp
+++ b/clang/unittests/Format/FormatTestObjC.cpp
@@ -1142,6 +1142,18 @@ TEST_F(FormatTestObjC, ObjCArrayLiterals) {
" @\"aaaaaaaaaaaaaaaaaaaaaaaaaa\"\n"
"];\n");
}
+
+TEST_F(FormatTestObjC, BreaksCallStatementWhereSemiJustOverTheLimit) {
+ Style.ColumnLimit = 60;
+ // If the statement starting with 'a = ...' is put on a single line, the ';'
+ // is at line 61.
+ verifyFormat("int f(int a) {\n"
+ " a = [self aaaaaaaaaa:bbbbbbbbb\n"
+ " ccccccccc:dddddddd\n"
+ " ee:fddd];\n"
+ "}");
+}
+
} // end namespace
} // end namespace format
} // end namespace clang
OpenPOWER on IntegriCloud