[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 16:03:33 PDT 2021


jloser updated this revision to Diff 370831.
jloser added a comment.

[NFC] Move naked `static_asserts` into test function


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,26 @@
+//===------------------------------ 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 void testDestructor() {
+  static_assert(std::is_nothrow_destructible_v<T>);
+  static_assert(std::is_trivially_destructible_v<T>);
+}
+
+void test() {
+  testDestructor<std::span<int, 1>>();
+  testDestructor<std::span<int>>();
+}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109286.370831.patch
Type: text/x-patch
Size: 1014 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210905/511dc220/attachment.bin>


More information about the libcxx-commits mailing list