[clang] [clang-format] Fix anonymous reference parameter with default value (PR #86254)
Björn Schäpers via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 25 13:04:21 PDT 2024
================
@@ -464,10 +464,11 @@ AlignTokenSequence(const FormatStyle &Style, unsigned Start, unsigned End,
if (i + 1 != Changes.size())
Changes[i + 1].PreviousEndOfTokenColumn += Shift;
- // If PointerAlignment is PAS_Right, keep *s or &s next to the token
+ // If PointerAlignment is PAS_Right, keep *s or &s next to the token,
+ // except if the token is equal, then a space is needed.
if ((Style.PointerAlignment == FormatStyle::PAS_Right ||
Style.ReferenceAlignment == FormatStyle::RAS_Right) &&
- CurrentChange.Spaces != 0) {
+ CurrentChange.Spaces != 0 && !CurrentChange.Tok->is(tok::equal)) {
----------------
HazardyKnusperkeks wrote:
```suggestion
CurrentChange.Spaces != 0 && CurrentChange.Tok->isNot(tok::equal)) {
```
https://github.com/llvm/llvm-project/pull/86254
More information about the cfe-commits
mailing list