[libcxx-commits] [libcxx] [libc++] Correct mask_array assignment (PR #219490)

via libcxx-commits libcxx-commits at lists.llvm.org
Fri Aug 28 07:51:58 PDT 2026


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 origin/main HEAD --extensions ,cpp -- libcxx/include/valarray libcxx/test/std/numerics/numarray/template.mask.array/mask.array.assign/mask_array.pass.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

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

``````````diff
diff --git a/libcxx/test/std/numerics/numarray/template.mask.array/mask.array.assign/mask_array.pass.cpp b/libcxx/test/std/numerics/numarray/template.mask.array/mask.array.assign/mask_array.pass.cpp
index 1fe617ff0..a42618f2f 100644
--- a/libcxx/test/std/numerics/numarray/template.mask.array/mask.array.assign/mask_array.pass.cpp
+++ b/libcxx/test/std/numerics/numarray/template.mask.array/mask.array.assign/mask_array.pass.cpp
@@ -52,12 +52,12 @@ int main(int, char**)
     assert(v1[15] == 15);
     }
     {
-    std::valarray<int> v = {1, 2, 3, 4};
-    v[(v % 2) == 0] = v[(v % 2) == 1];
-    assert(v[0] == 1);
-    assert(v[1] == 1);
-    assert(v[2] == 3);
-    assert(v[3] == 3);
+      std::valarray<int> v = {1, 2, 3, 4};
+      v[(v % 2) == 0]      = v[(v % 2) == 1];
+      assert(v[0] == 1);
+      assert(v[1] == 1);
+      assert(v[2] == 3);
+      assert(v[3] == 3);
     }
     // Test return value of assignment
     {

``````````

</details>


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


More information about the libcxx-commits mailing list