Skip to content

[clang-format 21.0.0] Operands aligned by AlignOperands are not aligned to equals signs aligned by AlignConsecutiveAssignments #126873

@ETG153

Description

@ETG153

As title reads: When an equals sign (=) is moved right by AlignConsecutiveAssignments, any binary sign following that row is aligned to where the sign would be if AlignConsecutiveAssignments was disabled.

Tested on/with:
C++ 11 - no other languages have been tested (yet)
clang-format 21.0.0git (https://github.com/llvm/llvm-project.git 64735ad)

Example:
AlignConsecutiveAssignments: Consecutive
AlignOperands: AlignAfterOperator

// Expected behavior:
veryveryverylongvariablename = somethingelse;
shortervariablename          = anotherveryveryveryverylonglonglongvariablename
                             + somevariablethatwastoolongtofitonthesamerow;

// What actually happens:
veryveryverylongvariablename = somethingelse;
shortervariablename          = anotherveryveryveryverylonglonglongvariablename
                    + somevariablethatwastoolongtofitonthesamerow;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions