clang 22.0.0git
clang::SpacesInParensCustom Struct Reference

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

#include "clang/Format/Format.h"

Public Member Functions

 SpacesInParensCustom ()
 SpacesInParensCustom (bool ExceptDoubleParentheses, bool InConditionalStatements, bool InCStyleCasts, bool InEmptyParentheses, bool Other)
bool operator== (const SpacesInParensCustom &R) const
bool operator!= (const SpacesInParensCustom &R) const

Public Attributes

bool ExceptDoubleParentheses
 Override any of the following options to prevent addition of space when both opening and closing parentheses use multiple parentheses.
bool InConditionalStatements
 Put a space in parentheses only inside conditional statements (for/if/while/switch...).
bool InCStyleCasts
 Put a space in C style casts.
bool InEmptyParentheses
 Insert a space in empty parentheses, i.e. ().
bool Other
 Put a space in parentheses not covered by preceding options.

Detailed Description

Precise control over the spacing in parentheses.

# Should be declared this way:
Other: true
SpacesInParensStyle SpacesInParens
If true, spaces will be inserted after ( and before ). This option is deprecated. The previous behavi...
Definition Format.h:4998
SpacesInParensCustom SpacesInParensOptions
Control of individual spaces in parentheses.
Definition Format.h:5091
bool Other
Put a space in parentheses not covered by preceding options.
Definition Format.h:5052
bool InConditionalStatements
Put a space in parentheses only inside conditional statements (for/if/while/switch....
Definition Format.h:5028
bool ExceptDoubleParentheses
Override any of the following options to prevent addition of space when both opening and closing pare...
Definition Format.h:5020

Definition at line 5009 of file Format.h.

Constructor & Destructor Documentation

◆ SpacesInParensCustom() [1/2]

clang::SpacesInParensCustom::SpacesInParensCustom ( )
inline

◆ SpacesInParensCustom() [2/2]

clang::SpacesInParensCustom::SpacesInParensCustom ( bool ExceptDoubleParentheses,
bool InConditionalStatements,
bool InCStyleCasts,
bool InEmptyParentheses,
bool Other )
inline

Member Function Documentation

◆ operator!=()

bool clang::SpacesInParensCustom::operator!= ( const SpacesInParensCustom & R) const
inline

Definition at line 5072 of file Format.h.

References SpacesInParensCustom().

◆ operator==()

bool clang::SpacesInParensCustom::operator== ( const SpacesInParensCustom & R) const
inline

Member Data Documentation

◆ ExceptDoubleParentheses

bool clang::SpacesInParensCustom::ExceptDoubleParentheses

Override any of the following options to prevent addition of space when both opening and closing parentheses use multiple parentheses.

true:
__decltype__(( x ))
if (( a = b ))
_Float16 __2f16 __attribute__((ext_vector_type(2)))
Zeroes the upper 128 bits (bits 255:128) of all YMM registers.
__device__ __2f16 b
#define noreturn
Definition stdnoreturn.h:17

false: Uses the applicable option.

Definition at line 5020 of file Format.h.

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

◆ InConditionalStatements

bool clang::SpacesInParensCustom::InConditionalStatements

Put a space in parentheses only inside conditional statements (for/if/while/switch...).

true: false:
if ( a ) { ... } vs. if (a) { ... }
while ( i < 5 ) { ... } while (i < 5) { ... }

Definition at line 5028 of file Format.h.

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

◆ InCStyleCasts

bool clang::SpacesInParensCustom::InCStyleCasts

Put a space in C style casts.

true: false:
x = ( int32 )y vs. x = (int32)y
y = (( int (*)(int) )foo)(x); y = ((int (*)(int))foo)(x);

Definition at line 5035 of file Format.h.

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

◆ InEmptyParentheses

bool clang::SpacesInParensCustom::InEmptyParentheses

Insert a space in empty parentheses, i.e. ().

true: false:
void f( ) { vs. void f() {
int x[] = {foo( ), bar( )}; int x[] = {foo(), bar()};
if (true) { if (true) {
f( ); f();
} }
} }

Definition at line 5046 of file Format.h.

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

◆ Other

bool clang::SpacesInParensCustom::Other

Put a space in parentheses not covered by preceding options.

true: false:
t f( Deleted & ) & = delete; vs. t f(Deleted &) & = delete;

Definition at line 5052 of file Format.h.

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


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