llvm / llvm-project

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

clang-format 14 indents brace list items weirdly #56041

Open chenhao94 opened 2 years ago

chenhao94 commented 2 years ago

If the variable is pushed further to align another variable, the items will also indent more, which is not an expected bahavior.

$ clang-format-14 -style="{AlignConsecutiveAssignments: AcrossComments}" 1.cc
int main() {
  using aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa = int;

  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa i = 1;
  std::vector<int> a                     = {
                          1,
                          2,
                          4,
                          8,
  };
  return 0;
}

It is not reproducible on either clang-format-13 or 15(git).

llvmbot commented 2 years ago

@llvm/issue-subscribers-clang-format