[clang-format] Fix indent of trailing raw string param after newline
authorKrasimir Georgiev <krasimir@google.com>
Thu, 18 Apr 2019 17:14:05 +0000 (17:14 +0000)
committerKrasimir Georgiev <krasimir@google.com>
Thu, 18 Apr 2019 17:14:05 +0000 (17:14 +0000)
commitbda8482abaa87376f08700876504267bafa09880
tree3a61efe6587a50d8bd142f08ab1ba55911cba5ce
parentadf288c5d93e60a91fe226ae2dcebad0f760a259
[clang-format] Fix indent of trailing raw string param after newline

Summary:
Currently clang-format uses ContinuationIndent to indent the contents of a raw
string literal that is the last parameter of the function call. This is to
achieve formatting similar to trailing:
```
f(1, 2, R"pb(
    x: y)pb");
```
However this had the unfortunate consequence of producing format like this:
```
fffffff(1, 2,
        R"pb(
    a: b
        )pb");
```

This patch makes clang-format consider indenting a trailing raw string param
after a newline based off the start of the format delimiter, producing:
```
fffffff(1, 2,
        R"pb(
          a: b
        )pb");
```

Reviewers: djasper

Reviewed By: djasper

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D60558

llvm-svn: 358689
clang/lib/Format/ContinuationIndenter.cpp
clang/lib/Format/ContinuationIndenter.h
clang/unittests/Format/FormatTestRawStrings.cpp