[clang-format] Don't break between string literal operands of << (#69871)
Fixes #44363.
This commit is contained in:
@@ -5117,10 +5117,6 @@ bool TokenAnnotator::mustBreakBefore(const AnnotatedLine &Line,
|
||||
return true;
|
||||
if (Left.IsUnterminatedLiteral)
|
||||
return true;
|
||||
if (Right.is(tok::lessless) && Right.Next && Left.is(tok::string_literal) &&
|
||||
Right.Next->is(tok::string_literal)) {
|
||||
return true;
|
||||
}
|
||||
if (Right.is(TT_RequiresClause)) {
|
||||
switch (Style.RequiresClausePosition) {
|
||||
case FormatStyle::RCPS_OwnLine:
|
||||
|
||||
@@ -26468,6 +26468,10 @@ TEST_F(FormatTest, PPBranchesInBracedInit) {
|
||||
"};");
|
||||
}
|
||||
|
||||
TEST_F(FormatTest, StreamOutputOperator) {
|
||||
verifyFormat("std::cout << \"foo\" << \"bar\" << baz;");
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace test
|
||||
} // namespace format
|
||||
|
||||
Reference in New Issue
Block a user