Skip to content

clang-format: Add options for SpacesInParentheses #55428

@Hedede

Description

@Hedede

I am working on a project where function declarations and functions calls are formatted differently:
void foo( Arg x, Arg y ); // decl
foo(a, b) // call

From what I could gather, SpacesInParentheses doens't support differentiation. There are SpacesInCStyleCastParentheses, SpacesInConditionalStatement, but that' snot enough.

I suggest to add something analogous to BraceWrapping

  • FunctionDecl (maybe also MemberFunctionDecl? I don't think it's needed though) void foo(A a)
  • FunctionCall foo(x)
  • FunctionLikeMacroDecl #define FOO( x )
  • FunctionLikeMacroCall FOO(x)
  • TemplateDecl template<typename T>
  • TemplateInstantiation Foo<T>
  • ConditionalStatement
  • Operator (sizeof, alignof...)
  • Decltype
  • Expression ( a + b )
  • CStyleCast
  • Braced initializer list
  • ... Maybe more?

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang-formatenhancementImproving things as opposed to bug fixing, e.g. new or missing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions