[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
Sat Mar 23 01:48:09 PDT 2024


================
@@ -471,6 +471,9 @@ AlignTokenSequence(const FormatStyle &Style, unsigned Start, unsigned End,
            Previous >= 0 &&
            Changes[Previous].Tok->getType() == TT_PointerOrReference;
            --Previous) {
+        // Don't align function default argument using return type maximum size
+        if (Changes[Previous + 1].Tok->is(tok::equal))
+          continue;
----------------
HazardyKnusperkeks wrote:

I have multiple issues with this snippet:
* I don't understand the comment.
* Comments end in full stop.
* You execute this in a loop, but it is either true on the first run or never.


https://github.com/llvm/llvm-project/pull/86254


More information about the cfe-commits mailing list