You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice to have a way to have an extra option to ReferenceAlignment (and PointerAlignment I guess) when QualifierAlignment is set to Right in order to remove any space between const and &, and still add spaces before & the rest of the time.
AFAIK, it is currently (*) impossible to format in the following way:
SomeType & lvref; // space before "&"
SomeType && rvref; // space before "&&"
SomeType const& cref; // no-space before "&", but before "const&"
SomeType const&& crvref // same thing
Indeed, if we select Middle for ReferenceAlignment, an extra space will be added to const &
(*) tested with clang-format 19, and the documentation of clang-format-21 shows no difference on the topic.
The text was updated successfully, but these errors were encountered:
It would be nice to have a way to have an extra option to `ReferenceAlignment` (and `PointerAlignment` I guess) when `QualifierAlignment` is set to `Right` in order to remove any space between `const` and `&`, and still add spaces before `&` the rest of the time.
AFAIK, it is currently (*) impossible to format in the following way:
SomeType & lvref; // space before "&"
SomeType && rvref; // space before "&&"
SomeType const& cref; // no-space before "&", but before "const&"
SomeType const&& crvref // same thing
Indeed, if we select Middle for ReferenceAlignment, an extra space will be added to const &
(*) tested with clang-format 19, and the documentation of clang-format-21 shows no difference on the topic.
It would be nice to have a way to have an extra option to
ReferenceAlignment
(andPointerAlignment
I guess) whenQualifierAlignment
is set toRight
in order to remove any space betweenconst
and&
, and still add spaces before&
the rest of the time.AFAIK, it is currently (*) impossible to format in the following way:
Indeed, if we select
Middle
forReferenceAlignment
, an extra space will be added toconst &
(*) tested with clang-format 19, and the documentation of clang-format-21 shows no difference on the topic.
The text was updated successfully, but these errors were encountered: