Skip to content

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

Merged
philnik777 merged 4 commits into
llvm:mainfrom
StephanTLavavej:stl-16-noexcept-strengthening
Dec 10, 2023
Merged

[libc++] LWG-4021 "mdspan::is_always_meow() should be noexcept", use LIBCPP_STATIC_ASSERT for noexcept strengthening#74254
philnik777 merged 4 commits into
llvm:mainfrom
StephanTLavavej:stl-16-noexcept-strengthening

Conversation

@StephanTLavavej

@StephanTLavavej StephanTLavavej commented Dec 3, 2023

Copy link
Copy Markdown
Member

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

  • I've filed LWG-4021 "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 asserts to static_asserts.
  • Improvement: Upgrade assert to static_assert when inspecting the noexceptness 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.)

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants