[libcxx-commits] [libcxx] [libc++][test] Fix MSVC warnings with `static_cast`s (PR #74962)

via libcxx-commits libcxx-commits at lists.llvm.org
Sat Dec 9 20:10:10 PST 2023


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 b85f1f9b182234ba366d78ae2174a149e44d08c1 97cb0824480dbb732fe6a6a1ea8efebd7b8ef3e1 -- libcxx/test/std/algorithms/alg.modifying.operations/alg.unique/ranges_unique_copy.pass.cpp libcxx/test/std/containers/sequences/insert_range_sequence_containers.h libcxx/test/std/containers/unord/unord.map/eq.different_hash.pass.cpp libcxx/test/std/containers/unord/unord.multimap/eq.different_hash.pass.cpp libcxx/test/std/containers/unord/unord.multiset/eq.different_hash.pass.cpp libcxx/test/std/containers/unord/unord.set/eq.different_hash.pass.cpp libcxx/test/std/containers/views/mdspan/layout_stride/index_operator.pass.cpp libcxx/test/std/ranges/range.utility/range.utility.conv/container.h libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/allocate_shared_for_overwrite.pass.cpp libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared_for_overwrite.pass.cpp libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.create/make_unique_for_overwrite.default_init.pass.cpp libcxx/test/support/concat_macros.h
``````````

</details>

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

``````````diff
diff --git a/libcxx/test/std/containers/sequences/insert_range_sequence_containers.h b/libcxx/test/std/containers/sequences/insert_range_sequence_containers.h
index 6e8fa1c205..352ee474ca 100644
--- a/libcxx/test/std/containers/sequences/insert_range_sequence_containers.h
+++ b/libcxx/test/std/containers/sequences/insert_range_sequence_containers.h
@@ -427,7 +427,7 @@ template <> constexpr TestCase<int> FullContainer_End_LongRange<bool> {
 template <class Container, class Iter, class Sent, class Validate>
 constexpr void test_sequence_insert_range(Validate validate) {
   using T = typename Container::value_type;
-  using D = typename Container::difference_type;
+  using D      = typename Container::difference_type;
   auto get_pos = [](auto& c, auto& test_case) { return std::ranges::next(c.begin(), static_cast<D>(test_case.index)); };
 
   auto test = [&](auto& test_case) {

``````````

</details>


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


More information about the libcxx-commits mailing list