[libcxx-commits] [PATCH] D111197: [libc++] Verify span and string_view are trivially copyable
Joe Loser via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Oct 6 10:30:17 PDT 2021
jloser added inline comments.
================
Comment at: libcxx/test/std/containers/views/trivially_copyable.compile.pass.cpp:8
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17
+
----------------
Mordante wrote:
> A bit pedantic, but this is only required in C++23 not in C++20. Can you add a comment. (P2251 was not retroactively applied.)
I can add a comment about it just working or mark it as `UNSUPPORTED: c++20`. Thanks for pointing out it doesn't retroactively apply to other standards modes. I don't feel strongly.
@ldionne @Quuxplusone - do either of you have strong opinions?
================
Comment at: libcxx/test/std/strings/string.view/trivially_copyable.compile.pass.cpp:9
+
+// <string_view>
+
----------------
Mordante wrote:
> Mordante wrote:
> > jloser wrote:
> > > Quuxplusone wrote:
> > > > This surely needs some `// UNSUPPORTED: c++03, c++11, c++14`, but buildkite will tell you for sure.
> > > > ...Actually, it looks like libc++ supports `string_view` as an extension all the way back to C++03? is that true? So you'll want to use `static_assert(std::is_trivially_copyable<...>::value, "");` below.
> > > Seems to be the case that `libc++` supports `string_view` all the way back to C++03 oddly enough. Just fixed up the `static_assert`s to play nicely with older modes.
> > libc++ originally "back-ported" several features to older standards. This gives us occasionally additional maintenance work. Nowadays we no longer back-port features.
> I wonder whether we should disable the test on older versions. This test will fail on MSVC STL in C++11 mode. Looking at cppreference.com I expect other implementations to be trivially copyable from the start.
I'd be OK marking this test as unsupported for all standards except C++23.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D111197/new/
https://reviews.llvm.org/D111197
More information about the libcxx-commits
mailing list