llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.11k stars 12.01k forks source link

`AlignAfterOpenBracket: BlockIndent` does not respect `BinPackParameters: false` #104873

Open akbyrd opened 2 months ago

akbyrd commented 2 months ago

Version: 18.1.8

Config

ColumnLimit: 30
AlignAfterOpenBracket: BlockIndent
BinPackParameters: false

Input

void f1_____(int token, float context) {
}

auto f2 = [](int token, float context) {
};

Actual Output

void f1_____(
    int token, float context
) {}

auto f2 = [](int token,
             float context) {
};

Expected Output

void f1_____(
    int token,
    float context
) {}

auto f2 = [](
    int token,
    float context
) {};

Notice the parameters to f1 are not on separate lines as they should be based on BinPackParameters: false. For comparison, parameters are on separate lines as expected with AlignAfterOpenBracket: BlockIndent. The only difference between those two should be the placement of the closing paren.

llvmbot commented 2 months ago

@llvm/issue-subscribers-clang-format

Author: Adam Byrd (akbyrd)

Version: 18.1.1 Config ``` ColumnLimit: 30 AlignAfterOpenBracket: BlockIndent BinPackParameters: false ``` Input ``` void f1_____(int token, float context) { } auto f2 = [](int token, float context) { }; ``` Actual Output ``` void f1_____( int token, float context ) {} auto f2 = [](int token, float context) { }; ``` Expected Output ``` void f1_____( int token, float context ) {} auto f2 = []( int token, float context ) {}; ``` Notice the parameters to `f1` are not on separate lines as they should be based on `BinPackParameters: false`. For comparison, parameters are on separate lines as expected with `AlignAfterOpenBracket: BlockIndent`. The only difference between those two should be the placement of the closing paren.