-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Open
Description
There are a small handful of flags under struct AlignConsecutiveStyle
which are only applicable to one of the seven AlignConsecutiveXYZ
options; however, their descriptions appear under each instance of AlignConsecutiveStyle (6 extraneous places).
The offending flags are AlignCompound
, AlignFunctionDeclarations
, AlignFunctionPointers
, and PadOperators
.
As generated:
llvm-project/clang/docs/ClangFormatStyleOptions.rst
Lines 383 to 447 in 569fcac
* ``bool AlignCompound`` Only for ``AlignConsecutiveAssignments``. Whether compound assignments | |
like ``+=`` are aligned along with ``=``. | |
.. code-block:: c++ | |
true: | |
a &= 2; | |
bbb = 2; | |
false: | |
a &= 2; | |
bbb = 2; | |
* ``bool AlignFunctionDeclarations`` Only for ``AlignConsecutiveDeclarations``. Whether function declarations | |
are aligned. | |
.. code-block:: c++ | |
true: | |
unsigned int f1(void); | |
void f2(void); | |
size_t f3(void); | |
false: | |
unsigned int f1(void); | |
void f2(void); | |
size_t f3(void); | |
* ``bool AlignFunctionPointers`` Only for ``AlignConsecutiveDeclarations``. Whether function pointers are | |
aligned. | |
.. code-block:: c++ | |
true: | |
unsigned i; | |
int &r; | |
int *p; | |
int (*f)(); | |
false: | |
unsigned i; | |
int &r; | |
int *p; | |
int (*f)(); | |
* ``bool PadOperators`` Only for ``AlignConsecutiveAssignments``. Whether short assignment | |
operators are left-padded to the same length as long ones in order to | |
put all assignment operators to the right of the left hand side. | |
.. code-block:: c++ | |
true: | |
a >>= 2; | |
bbb = 2; | |
a = 2; | |
bbb >>= 2; | |
false: | |
a >>= 2; | |
bbb = 2; | |
a = 2; | |
bbb >>= 2; | |
In source header:
llvm-project/clang/include/clang/Format/Format.h
Lines 217 to 277 in 569fcac
/// Only for ``AlignConsecutiveAssignments``. Whether compound assignments | |
/// like ``+=`` are aligned along with ``=``. | |
/// \code | |
/// true: | |
/// a &= 2; | |
/// bbb = 2; | |
/// | |
/// false: | |
/// a &= 2; | |
/// bbb = 2; | |
/// \endcode | |
bool AlignCompound; | |
/// Only for ``AlignConsecutiveDeclarations``. Whether function declarations | |
/// are aligned. | |
/// \code | |
/// true: | |
/// unsigned int f1(void); | |
/// void f2(void); | |
/// size_t f3(void); | |
/// | |
/// false: | |
/// unsigned int f1(void); | |
/// void f2(void); | |
/// size_t f3(void); | |
/// \endcode | |
bool AlignFunctionDeclarations; | |
/// Only for ``AlignConsecutiveDeclarations``. Whether function pointers are | |
/// aligned. | |
/// \code | |
/// true: | |
/// unsigned i; | |
/// int &r; | |
/// int *p; | |
/// int (*f)(); | |
/// | |
/// false: | |
/// unsigned i; | |
/// int &r; | |
/// int *p; | |
/// int (*f)(); | |
/// \endcode | |
bool AlignFunctionPointers; | |
/// Only for ``AlignConsecutiveAssignments``. Whether short assignment | |
/// operators are left-padded to the same length as long ones in order to | |
/// put all assignment operators to the right of the left hand side. | |
/// \code | |
/// true: | |
/// a >>= 2; | |
/// bbb = 2; | |
/// | |
/// a = 2; | |
/// bbb >>= 2; | |
/// | |
/// false: | |
/// a >>= 2; | |
/// bbb = 2; | |
/// | |
/// a = 2; | |
/// bbb >>= 2; | |
/// \endcode | |
bool PadOperators; |