[libcxx-commits] [PATCH] D109286: [libc++][NFC] Test span is nothrow trivially destructible
Joe Loser via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Sun Sep 5 15:53:35 PDT 2021
jloser updated this revision to Diff 370830.
jloser added a comment.
Convert test to compile time only test
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D109286/new/
https://reviews.llvm.org/D109286
Files:
libcxx/test/std/containers/views/span.cons/span.dtor.compile.pass.cpp
Index: libcxx/test/std/containers/views/span.cons/span.dtor.compile.pass.cpp
===================================================================
--- /dev/null
+++ libcxx/test/std/containers/views/span.cons/span.dtor.compile.pass.cpp
@@ -0,0 +1,23 @@
+//===------------------------------ span ---------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===---------------------------------------------------------------------===//
+// UNSUPPORTED: c++03, c++11, c++14, c++17
+
+// <span>
+
+// ~span() = default;
+
+#include <span>
+#include <type_traits>
+
+template <class T>
+constexpr bool test() {
+ return std::is_nothrow_destructible_v<T> && std::is_trivially_destructible_v<T>;
+}
+
+static_assert(test<std::span<int, 1>>());
+static_assert(test<std::span<int>>());
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109286.370830.patch
Type: text/x-patch
Size: 968 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210905/e2608bf5/attachment.bin>
More information about the libcxx-commits
mailing list