[all-commits] [llvm/llvm-project] 67c403: [libc++] LWG-4021 "`mdspan::is_always_meow()` shou...

Stephan T. Lavavej via All-commits all-commits at lists.llvm.org
Sun Dec 10 02:52:26 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 67c4033358f39adcba53e9b70bdd4799c5a306ac
      https://github.com/llvm/llvm-project/commit/67c4033358f39adcba53e9b70bdd4799c5a306ac
  Author: Stephan T. Lavavej <stl at nuwen.net>
  Date:   2023-12-10 (Sun, 10 Dec 2023)

  Changed paths:
    M libcxx/include/__mdspan/mdspan.h
    M libcxx/include/mdspan
    M libcxx/test/std/containers/views/mdspan/mdspan/ctor.dh_array.pass.cpp
    M libcxx/test/std/containers/views/mdspan/mdspan/ctor.dh_extents.pass.cpp
    M libcxx/test/std/containers/views/mdspan/mdspan/ctor.dh_map.pass.cpp
    M libcxx/test/std/containers/views/mdspan/mdspan/ctor.dh_map_acc.pass.cpp
    M libcxx/test/std/containers/views/mdspan/mdspan/ctor.dh_span.pass.cpp
    M libcxx/test/std/containers/views/mdspan/mdspan/properties.pass.cpp
    M libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.assign/member_swap_noexcept.pass.cpp
    M libcxx/test/std/input.output/string.streams/stringbuf/stringbuf.assign/nonmember_swap_noexcept.pass.cpp
    M libcxx/test/std/iterators/iterator.requirements/iterator.cust/iterator.cust.move/iter_move.pass.cpp
    M libcxx/test/std/ranges/range.adaptors/range.elements/iterator/base.pass.cpp

  Log Message:
  -----------
  [libc++] LWG-4021 "`mdspan::is_always_meow()` should be `noexcept`", use `LIBCPP_STATIC_ASSERT` for `noexcept` strengthening (#74254)

Found while running libc++'s test suite with MSVC's STL.

* I've filed [LWG-4021](https://cplusplus.github.io/LWG/issue4021)
"`mdspan::is_always_meow()` should be `noexcept`" and implemented this
in libc++'s product and test code.
* Use `LIBCPP_STATIC_ASSERT` to avoid issues with `noexcept`
strengthening in MSVC's STL.
+ As permitted by the Standard, MSVC's STL conditionally strengthens
`mdspan` construction/`is_meow`/`stride` and `elements_view` iterator
`base() &&`, and always strengthens `basic_stringbuf` `swap`.
+ In `mdspan/properties.pass.cpp`, this also upgrades runtime `assert`s
to `static_assert`s.
* Improvement: Upgrade `assert` to `static_assert` when inspecting the
`noexcept`ness of `std::ranges::iter_move`. (These `!noexcept` tests
weren't causing issues for MSVC's STL, so I didn't change them to be
libc++-specific.)




More information about the All-commits mailing list