[clang] [clang-format] Add SpacesInParensOption for filtering repeated parens (PR #77522)

Gedare Bloom via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 20 11:34:15 PDT 2024


gedare wrote:

> > I saw some comments on this. Looks like some were deleted maybe. This is still in my queue, but unclear when I'll get back to it.
> 
> Yeah, sorry, I posted a comment here but decided it was a bit irrelevant. :)
> 
> But going to ask anyway then. Can this setting remove the space from repeated parentheses pattern like this?
> 
> ```c
> foo( (void *)buf, size );
> ```
> 
> to:
> 
> ```c
> foo((void *)buf, size );
> ```
> 
> So it does remove it on one side where the C-style cast parentheses, but doesn't on the other side?

No, at present this would not be supported. You might be able to mimic the logic here to do it, but it would also need some good justification that there is an existing style that uses it.

https://github.com/llvm/llvm-project/pull/77522


More information about the cfe-commits mailing list