summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2015-05-19 11:06:33 +0000
committerDaniel Jasper <djasper@google.com>2015-05-19 11:06:33 +0000
commited41f774fca65e8d9319e66b7128da48d85724fc (patch)
tree033f88f40e294e14b27f5285c27957e0582968b1 /clang
parent5cdda674c6daa61a0f6c679d70bf878a112f2c8d (diff)
downloadbcm5719-llvm-ed41f774fca65e8d9319e66b7128da48d85724fc.tar.gz
bcm5719-llvm-ed41f774fca65e8d9319e66b7128da48d85724fc.zip
clang-format: Fix regression caused by r237244.
Before: [call aaaaaaaa.aaaaaaaa.aaaaaaaa.aaaaaaaa.aaaaaaaa.aaaaaaaa.aaaaaaaa.aaaaaaaa. aaaaaaaa]; After: [call aaaaaaaa.aaaaaaaa.aaaaaaaa.aaaaaaaa.aaaaaaaa.aaaaaaaa.aaaaaaaa.aaaaaaaa .aaaaaaaa]; This merely papers over the fact that we aren't parsing ObjC method calls correctly. Also, the indentation is weird. llvm-svn: 237681
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/Format/TokenAnnotator.cpp2
-rw-r--r--clang/unittests/Format/FormatTest.cpp3
2 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp
index f4b2f006556..d3122615c83 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -2132,7 +2132,7 @@ bool TokenAnnotator::canBreakBefore(const AnnotatedLine &Line,
return true;
if (Right.is(TT_SelectorName) || (Right.is(tok::identifier) && Right.Next &&
Right.Next->is(TT_ObjCMethodExpr)))
- return true;
+ return Left.isNot(tok::period); // FIXME: Properly parse ObjC calls.
if (Left.is(tok::r_paren) && Line.Type == LT_ObjCProperty)
return true;
if (Left.ClosesTemplateDeclaration)
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index ab09e0075d6..3903ac31e83 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -7340,6 +7340,9 @@ TEST_F(FormatTest, FormatObjCMethodExpr) {
" aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa];");
verifyFormat("[aaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaa[aaaaaaaaaaaaaaaaaaaaa]\n"
" aaaaaaaaaaaaaaaaaaaaaa];");
+ verifyFormat("[call aaaaaaaa.aaaaaa.aaaaaaaa.aaaaaaaa.aaaaaaaa.aaaaaaaa\n"
+ " .aaaaaaaa];", // FIXME: Indentation seems off.
+ getLLVMStyleWithColumns(60));
verifyFormat(
"scoped_nsobject<NSTextField> message(\n"
OpenPOWER on IntegriCloud