diff options
author | Daniel Jasper <djasper@google.com> | 2014-06-10 06:27:23 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2014-06-10 06:27:23 +0000 |
commit | 3251fff0e3d1fa4389ccef5ffa3223e47739f5af (patch) | |
tree | 4fb5178b255907bc93fa2d402e152cca1f204b8b /clang/lib/Format/ContinuationIndenter.cpp | |
parent | ed2c033b9beed8448945e340195ec426ef73ffdd (diff) | |
download | bcm5719-llvm-3251fff0e3d1fa4389ccef5ffa3223e47739f5af.tar.gz bcm5719-llvm-3251fff0e3d1fa4389ccef5ffa3223e47739f5af.zip |
clang-format: Handle multiline strings inside ternary expressions.
With AlwaysSplitBeforeMultilineStrings, clang-format would not find any
valid solution.
llvm-svn: 210513
Diffstat (limited to 'clang/lib/Format/ContinuationIndenter.cpp')
-rw-r--r-- | clang/lib/Format/ContinuationIndenter.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp index 308fc623d82..5d59f19edfb 100644 --- a/clang/lib/Format/ContinuationIndenter.cpp +++ b/clang/lib/Format/ContinuationIndenter.cpp @@ -146,7 +146,8 @@ bool ContinuationIndenter::mustBreak(const LineState &State) { if (Style.AlwaysBreakBeforeMultilineStrings && State.Column > State.Stack.back().Indent && // Breaking saves columns. !Previous.isOneOf(tok::kw_return, tok::lessless, tok::at) && - Previous.Type != TT_InlineASMColon && nextIsMultilineString(State)) + Previous.Type != TT_InlineASMColon && + Previous.Type != TT_ConditionalExpr && nextIsMultilineString(State)) return true; if (((Previous.Type == TT_DictLiteral && Previous.is(tok::l_brace)) || Previous.Type == TT_ArrayInitializerLSquare) && |