diff options
author | Daniel Jasper <djasper@google.com> | 2015-04-07 06:41:24 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2015-04-07 06:41:24 +0000 |
commit | 9dedc775d7b436e5f8f961413c3fd867ea8be53e (patch) | |
tree | 6a4a1adc9a322bdac1304173cc44d1cc7dfb797c | |
parent | 2be1bbea7ec6f74f1415912005c05992548d06b6 (diff) | |
download | bcm5719-llvm-9dedc775d7b436e5f8f961413c3fd867ea8be53e.tar.gz bcm5719-llvm-9dedc775d7b436e5f8f961413c3fd867ea8be53e.zip |
clang-format: Indent relative to the ./-> and not the function name.
Before:
aaaaaaaaaaa //
.aaaa( //
bbbb) // This is different ..
.aaaa( //
cccc); // .. from this.
After:
aaaaaaaaaaa //
.aaaa( //
bbbb) // This is identical ..
.aaaa( //
cccc); // .. to this.
llvm-svn: 234300
-rw-r--r-- | clang/lib/Format/ContinuationIndenter.cpp | 2 | ||||
-rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 4 | ||||
-rw-r--r-- | clang/unittests/Format/FormatTestJava.cpp | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp index 83fd6ee2497..3e4bf3e88a3 100644 --- a/clang/lib/Format/ContinuationIndenter.cpp +++ b/clang/lib/Format/ContinuationIndenter.cpp @@ -634,7 +634,7 @@ unsigned ContinuationIndenter::moveStateToNextToken(LineState &State, std::min(State.LowestLevelOnLine, Current.NestingLevel); if (Current.isMemberAccess()) State.Stack.back().StartOfFunctionCall = - Current.LastOperator ? 0 : State.Column + Current.ColumnWidth; + Current.LastOperator ? 0 : State.Column; if (Current.is(TT_SelectorName)) State.Stack.back().ObjCSelectorNameFound = true; if (Current.is(TT_CtorInitializerColon)) { diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index 287ece17e58..bf98eceacd8 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -4085,7 +4085,7 @@ TEST_F(FormatTest, FormatsBuilderPattern) { " aaaaaaaaaaaaaaa->aaaaa().aaaaaaaaaaaaa().aaaaaa();"); verifyFormat( "aaaaaaa->aaaaaaa->aaaaaaaaaaaaaaaa(\n" - " aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)\n" + " aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)\n" " ->aaaaaaaa(aaaaaaaaaaaaaaa);"); verifyFormat( "aaaaaaaaaaaaaaaaaaa()->aaaaaa(bbbbb)->aaaaaaaaaaaaaaaaaaa( // break\n" @@ -4094,7 +4094,7 @@ TEST_F(FormatTest, FormatsBuilderPattern) { "aaaaaaaaaaaaaaaaaaaaaaa *aaaaaaaaa =\n" " aaaaaa->aaaaaaaaaaaa()\n" " ->aaaaaaaaaaaaaaaa(\n" - " aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)\n" + " aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)\n" " ->aaaaaaaaaaaaaaaaa();"); verifyGoogleFormat( "void f() {\n" diff --git a/clang/unittests/Format/FormatTestJava.cpp b/clang/unittests/Format/FormatTestJava.cpp index 6e3f7efaf27..631a3dca27e 100644 --- a/clang/unittests/Format/FormatTestJava.cpp +++ b/clang/unittests/Format/FormatTestJava.cpp @@ -433,7 +433,7 @@ TEST_F(FormatTestJava, NeverAlignAfterReturn) { getStyleWithColumns(40)); verifyFormat("return aaaaaaaaaaaaaaaaaaa()\n" " .bbbbbbbbbbbbbbbbbbb(\n" - " ccccccccccccccc)\n" + " ccccccccccccccc)\n" " .ccccccccccccccccccc();", getStyleWithColumns(40)); } |