Issue 173081
Summary [clang-format] formatting changes when applied a second time
Labels clang-format
Assignees
Reporter joelhock
    currently happening at HEAD (100077dbff5f) but same thing happens on an old v13.0.0 binary. this code snippet:
```cpp
// .clang-format file
// ---
// ContinuationIndentWidth: 8
// IndentWidth:     4
// ...

// $ clang-format --version
// clang-format version 22.0.0git (https://github.com/llvm/llvm-project.git 100077dbff5f24c4a4548d4859e5b4cff852512a)

struct foo {
void bar() {
{
{
{
{
{
FooTuple<FooInt<unsigned char, 2 /* commentabcde */> /* anothercomment */, FooInt<uint8_t, 0> /* comment */> baz;
}
}
}
}
}
}
};
```
run the first time results in
```cpp
struct foo {
    void bar() {
        {
            {
 {
                    {
                        {
 FooTuple<FooInt<unsigned char,
 2 /* commentabcde */> /* anothercomment
 */
 ,
                                     FooInt<uint8_t, 0> /* comment */>
 baz;
                        }
 }
                }
            }
        }
    }
};
```
and the second and later runs settle on this instead:
```cpp
struct foo {
 void bar() {
        {
            {
                {
 {
                        {
                            FooTuple<
 FooInt<unsigned char,
 2 /* commentabcde */> /* anothercomment
 */
 ,
                                    FooInt<uint8_t, 0> /* comment */>
                                    baz;
                        }
 }
                }
            }
        }
 }
};
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to