Skip to content

[clang-format] Formatting chained stream output (bitwise left shift) operators << #93034

Closed as not planned
@Alexolut

Description

@Alexolut

In clang-format 18.1.0-18.1.4 the following code doesn't changed after formatting based on Google-style:

stream << "A" << "B" << "C" << "D";

In other words as long as we fit in line length, all is places in one line.

But in 18.1.5 and 18.1.6 every operand is placed on the different line despite the allowed length of line like this:

stream << "A"
       << "B"
       << "C"
       << "D";

Which behavior is considered correct? Is there a way to configure this behavior by some format option?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions