Issue 76511
Summary Clang-Format fails to properly format function call
Labels clang-format
Assignees
Reporter Folling
    I'm using Clang-Format@18 to format a C++ project. I have a function call that is being formatted improperly. My [.clang-format file](https://github.com/llvm/llvm-project/files/13787860/clang-format.txt) is attached. I've tried different versions and configuration options but couldn't get it to work.

## What I got
```cpp
struct Bar {
 int get(int x) {
        return x;
    }
};

Bar create_bar(int param) {
    return Bar{};
}

int foo() {
 auto extremelylengthynamesothatclangformatstillcreatesalinebreaklettingmeshowcasetheproblemproperlyandwithoutfault1234567890 = 5;

    return create_bar(
 extremelylengthynamesothatclangformatstillcreatesalinebreaklettingmeshowcasetheproblemproperlyandwithoutfault1234567890
 )
        .get(5);
}
```

## What I expected
```cpp
struct Bar {
    int get(int x) {
        return x;
    }
};

Bar create_bar(int param) {
    return Bar{};
}

int foo() {
    auto extremelylengthynamesothatclangformatstillcreatesalinebreaklettingmeshowcasetheproblemproperlyandwithoutfault1234567890 = 5;

    return create_bar(
 extremelylengthynamesothatclangformatstillcreatesalinebreaklettingmeshowcasetheproblemproperlyandwithoutfault1234567890
 ).get(5);
}
```

I have tried changing all settings related to Indents, Constructors, Parameters, and function calls.
I also tried playing around with the brace wrapping style and with penalties.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to