Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clang-format: missing BraceWrapping configuration for multiline initialization list #81

Closed
alejandroclaro opened this issue Apr 7, 2023 · 2 comments

Comments

@alejandroclaro
Copy link

alejandroclaro commented Apr 7, 2023

It's not possible to adjust the position of braces when there is a multiple lines initialization list.

For example, in a code bases with Allman-like braces placement style. This

  std::vector<Bar> foo = 
  {
    makeBar(x, y, z),
    makeBar(u, v, w)
  };
  
  std::vector<int> baz = { 1, 2 };

is always transformed into this:

  std::vector<Bar> foo =  {
    makeBar(x, y, z),
    makeBar(u, v, w)
  };
  
  std::vector<int> baz = { 1, 2 };

It looks like there is a blocked PR related to this here: https://reviews.llvm.org/D91949

@alejandroclaro alejandroclaro closed this as not planned Won't fix, can't repro, duplicate, stale Apr 7, 2023
@alejandroclaro
Copy link
Author

Sorry for this. I mistakenly reported the problem in the wrong repository

@Junjie-Fan
Copy link

It's not possible to adjust the position of braces when there is a multiple lines initialization list.

For example, in a code bases with Allman-like braces placement style. This

  std::vector<Bar> foo = 
  {
    makeBar(x, y, z),
    makeBar(u, v, w)
  };
  
  std::vector<int> baz = { 1, 2 };

is always transformed into this:

  std::vector<Bar> foo =  {
    makeBar(x, y, z),
    makeBar(u, v, w)
  };
  
  std::vector<int> baz = { 1, 2 };

It looks like there is a blocked PR related to this here: https://reviews.llvm.org/D91949

does some format config can solve this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants