llvm / llvm-project

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

Formatter incorrectly formats braced list #63073

Open ilya-biryukov opened 1 year ago

ilya-biryukov commented 1 year ago

Input:

// clang-format --style=Google 
int foo() {
  return {
      identifierLong,
      identifierLong2,
      identifierLongLongLongLong1,
      identifierLong3,
      /*is_active=*/true,
      /*is_twin=*/true};
}

Current output:

int foo() {
  return {identifierLong,     identifierLong2, identifierLongLongLongLong1,
          identifierLong3,
          /*is_active=*/true,
          /*is_twin=*/true};
}

Note how identifierLong2 gets some space added before it for no reason. Expected output: same as input, i.e. one item per line.

llvmbot commented 1 year ago

@llvm/issue-subscribers-clang-format