clang 22.0.0git
clang::SpaceBeforeParensCustom Struct Reference

Precise control over the spacing before parentheses. More...

#include "clang/Format/Format.h"

Public Member Functions

 SpaceBeforeParensCustom ()
bool operator== (const SpaceBeforeParensCustom &Other) const

Public Attributes

bool AfterControlStatements
 If true, put space between control statement keywords (for/if/while...) and opening parentheses.
bool AfterForeachMacros
 If true, put space between foreach macros and opening parentheses.
bool AfterFunctionDeclarationName
 If true, put a space between function declaration name and opening parentheses.
bool AfterFunctionDefinitionName
 If true, put a space between function definition name and opening parentheses.
bool AfterIfMacros
 If true, put space between if macros and opening parentheses.
bool AfterNot
 If true, put a space between alternative operator not and the opening parenthesis.
bool AfterOverloadedOperator
 If true, put a space between operator overloading and opening parentheses.
bool AfterPlacementOperator
 If true, put a space between operator new/delete and opening parenthesis.
bool AfterRequiresInClause
 If true, put space between requires keyword in a requires clause and opening parentheses, if there is one.
bool AfterRequiresInExpression
 If true, put space between requires keyword in a requires expression and opening parentheses.
bool BeforeNonEmptyParentheses
 If true, put a space before opening parentheses only if the parentheses are not empty.

Detailed Description

Precise control over the spacing before parentheses.

# Should be declared this way:
SpaceBeforeParensCustom SpaceBeforeParensOptions
Control of individual space before parentheses.
Definition Format.h:4795
SpaceBeforeParensStyle SpaceBeforeParens
Defines in which cases to put a space before opening parentheses.
Definition Format.h:4661
bool AfterFunctionDefinitionName
If true, put a space between function definition name and opening parentheses.
Definition Format.h:4699
bool AfterControlStatements
If true, put space between control statement keywords (for/if/while...) and opening parentheses.
Definition Format.h:4678

Definition at line 4671 of file Format.h.

Constructor & Destructor Documentation

◆ SpaceBeforeParensCustom()

Member Function Documentation

◆ operator==()

Member Data Documentation

◆ AfterControlStatements

bool clang::SpaceBeforeParensCustom::AfterControlStatements

If true, put space between control statement keywords (for/if/while...) and opening parentheses.

true: false:
if (...) {} vs. if(...) {}

Definition at line 4678 of file Format.h.

Referenced by operator==(), and SpaceBeforeParensCustom().

◆ AfterForeachMacros

bool clang::SpaceBeforeParensCustom::AfterForeachMacros

If true, put space between foreach macros and opening parentheses.

true: false:
FOREACH (...) vs. FOREACH(...)
<loop-body> <loop-body>

Definition at line 4685 of file Format.h.

Referenced by operator==(), and SpaceBeforeParensCustom().

◆ AfterFunctionDeclarationName

bool clang::SpaceBeforeParensCustom::AfterFunctionDeclarationName

If true, put a space between function declaration name and opening parentheses.

true: false:
void f (); vs. void f();

Definition at line 4692 of file Format.h.

Referenced by operator==(), and SpaceBeforeParensCustom().

◆ AfterFunctionDefinitionName

bool clang::SpaceBeforeParensCustom::AfterFunctionDefinitionName

If true, put a space between function definition name and opening parentheses.

true: false:
void f () {} vs. void f() {}

Definition at line 4699 of file Format.h.

Referenced by operator==(), and SpaceBeforeParensCustom().

◆ AfterIfMacros

bool clang::SpaceBeforeParensCustom::AfterIfMacros

If true, put space between if macros and opening parentheses.

true: false:
IF (...) vs. IF(...)
<conditional-body> <conditional-body>

Definition at line 4706 of file Format.h.

Referenced by operator==(), and SpaceBeforeParensCustom().

◆ AfterNot

bool clang::SpaceBeforeParensCustom::AfterNot

If true, put a space between alternative operator not and the opening parenthesis.

true: false:
return not (a || b); vs. return not(a || b);
__device__ __2f16 b
#define not
Definition iso646.h:22

Definition at line 4713 of file Format.h.

Referenced by operator==(), and SpaceBeforeParensCustom().

◆ AfterOverloadedOperator

bool clang::SpaceBeforeParensCustom::AfterOverloadedOperator

If true, put a space between operator overloading and opening parentheses.

true: false:
void operator++ (int a); vs. void operator++(int a);
object.operator++ (10); object.operator++(10);

Definition at line 4721 of file Format.h.

Referenced by operator==(), and SpaceBeforeParensCustom().

◆ AfterPlacementOperator

bool clang::SpaceBeforeParensCustom::AfterPlacementOperator

If true, put a space between operator new/delete and opening parenthesis.

true: false:
new (buf) T; vs. new(buf) T;
delete (buf) T; delete(buf) T;
const FunctionProtoType * T

Definition at line 4729 of file Format.h.

Referenced by operator==(), and SpaceBeforeParensCustom().

◆ AfterRequiresInClause

bool clang::SpaceBeforeParensCustom::AfterRequiresInClause

If true, put space between requires keyword in a requires clause and opening parentheses, if there is one.

true: false:
template<typename T> vs. template<typename T>
requires (A<T> && B<T>) requires(A<T> && B<T>)
... ...

Definition at line 4738 of file Format.h.

Referenced by operator==(), and SpaceBeforeParensCustom().

◆ AfterRequiresInExpression

bool clang::SpaceBeforeParensCustom::AfterRequiresInExpression

If true, put space between requires keyword in a requires expression and opening parentheses.

true: false:
template<typename T> vs. template<typename T>
concept C = requires (T t) { concept C = requires(T t) {
... ...
} }

Definition at line 4748 of file Format.h.

Referenced by operator==(), and SpaceBeforeParensCustom().

◆ BeforeNonEmptyParentheses

bool clang::SpaceBeforeParensCustom::BeforeNonEmptyParentheses

If true, put a space before opening parentheses only if the parentheses are not empty.

true: false:
void f (int a); vs. void f();
f (a); f();

Definition at line 4756 of file Format.h.

Referenced by operator==(), and SpaceBeforeParensCustom().


The documentation for this struct was generated from the following file: