Issue 115617
Summary [clang-format] Additional flag of SpaceBeforeParensOptions for C variable declaration required.
Labels clang-format
Assignees
Reporter adong660
    At present, SpaceBeforeParens and its associated SpaceBeforeParensOptions options have limited support on C variable declaration. 

If we have a line of C code like
`int (*ptr)[4];`
It turns out that, if I want to reserve the space between `int` and `(*ptr)`, I have no choice but to set SpaceBeforeParens to be `Always`, which prevents me from control the existence of spaces at other places more better. Therefore, I hope there would be a flag called `AfterBaseType` for SpaceBeforeParensOptions.

I believe that a space at that place is a desired feature among many people, because the exsiting PointerAlignment and ReferenceAlignment options both add at least one space after the type, such as `int *ptr`, `int* ptr`, or `int * ptr`. Generally speaking, a space between the type name and "something following it" should be desired (although some people like to put `int` and `*` together, in which case the space comes a bit later, after the `*`).
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to