Open
Description
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.