[clang] [clang-format] Fix anonymous reference parameter with default value (PR #86254)

via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 22 00:23:55 PDT 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 65ae09eeb6773b14189fc67051870c8fc4eb9ae3 3feaef98f0b47de919146e05daeb37552bfea36a -- clang/lib/Format/WhitespaceManager.cpp clang/unittests/Format/FormatTest.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/Format/WhitespaceManager.cpp b/clang/lib/Format/WhitespaceManager.cpp
index c4a7d54e5b..a04aca47b1 100644
--- a/clang/lib/Format/WhitespaceManager.cpp
+++ b/clang/lib/Format/WhitespaceManager.cpp
@@ -472,9 +472,8 @@ AlignTokenSequence(const FormatStyle &Style, unsigned Start, unsigned End,
            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)) {
+        if (Changes[Previous + 1].Tok->is(tok::equal))
           continue;
-        }
         assert(Changes[Previous].Tok->isPointerOrReference());
         if (Changes[Previous].Tok->isNot(tok::star)) {
           if (ReferenceNotRightAligned)

``````````

</details>


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


More information about the cfe-commits mailing list