[libcxx-commits] [libcxx] [libc++][test] Use `LIBCPP_STATIC_ASSERT` to deal with `noexcept` strengthening (PR #74254)

via libcxx-commits libcxx-commits at lists.llvm.org
Sat Dec 9 17:28:42 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 e315bf25a843582de39257e1345408a10dc08224 8c626d0216432730d1843b801e3921e164cbdf6d -- libcxx/include/__mdspan/mdspan.h libcxx/include/mdspan libcxx/test/std/containers/views/mdspan/mdspan/ctor.dh_array.pass.cpp libcxx/test/std/containers/views/mdspan/mdspan/ctor.dh_extents.pass.cpp libcxx/test/std/containers/views/mdspan/mdspan/ctor.dh_map.pass.cpp libcxx/test/std/containers/views/mdspan/mdspan/ctor.dh_map_acc.pass.cpp libcxx/test/std/containers/views/mdspan/mdspan/ctor.dh_span.pass.cpp libcxx/test/std/containers/views/mdspan/mdspan/properties.pass.cpp libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.assign/member_swap_noexcept.pass.cpp libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.assign/nonmember_swap_noexcept.pass.cpp libcxx/test/std/iterators/iterator.requirements/iterator.cust/iterator.cust.move/iter_move.pass.cpp libcxx/test/std/ranges/range.adaptors/range.elements/iterator/base.pass.cpp
``````````

</details>

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

``````````diff
diff --git a/libcxx/include/__mdspan/mdspan.h b/libcxx/include/__mdspan/mdspan.h
index 84e27f2a02..684828eb90 100644
--- a/libcxx/include/__mdspan/mdspan.h
+++ b/libcxx/include/__mdspan/mdspan.h
@@ -246,8 +246,12 @@ public:
 
   // per LWG-4021 "mdspan::is_always_meow() should be noexcept"
   _LIBCPP_HIDE_FROM_ABI static constexpr bool is_always_unique() noexcept { return mapping_type::is_always_unique(); };
-  _LIBCPP_HIDE_FROM_ABI static constexpr bool is_always_exhaustive() noexcept { return mapping_type::is_always_exhaustive(); };
-  _LIBCPP_HIDE_FROM_ABI static constexpr bool is_always_strided() noexcept { return mapping_type::is_always_strided(); };
+  _LIBCPP_HIDE_FROM_ABI static constexpr bool is_always_exhaustive() noexcept {
+    return mapping_type::is_always_exhaustive();
+  };
+  _LIBCPP_HIDE_FROM_ABI static constexpr bool is_always_strided() noexcept {
+    return mapping_type::is_always_strided();
+  };
 
   _LIBCPP_HIDE_FROM_ABI constexpr bool is_unique() const { return __map_.is_unique(); };
   _LIBCPP_HIDE_FROM_ABI constexpr bool is_exhaustive() const { return __map_.is_exhaustive(); };

``````````

</details>


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


More information about the libcxx-commits mailing list