[libcxx-commits] [PATCH] D62618: [libcxx] Make std::tuple<> trivially constructible

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jun 11 07:59:21 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL363075: [libcxx] Make std::tuple<> trivially constructible (authored by ldionne, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D62618?vs=202236&id=204074#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62618/new/

https://reviews.llvm.org/D62618

Files:
  libcxx/trunk/include/tuple
  libcxx/trunk/test/libcxx/utilities/tuple/tuple.tuple/tuple.cnstr/empty_tuple_trivial.pass.cpp


Index: libcxx/trunk/include/tuple
===================================================================
--- libcxx/trunk/include/tuple
+++ libcxx/trunk/include/tuple
@@ -907,7 +907,7 @@
 {
 public:
     _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR tuple() _NOEXCEPT {}
+    _LIBCPP_CONSTEXPR tuple() _NOEXCEPT = default;
     template <class _Alloc>
     _LIBCPP_INLINE_VISIBILITY
         tuple(allocator_arg_t, const _Alloc&) _NOEXCEPT {}
Index: libcxx/trunk/test/libcxx/utilities/tuple/tuple.tuple/tuple.cnstr/empty_tuple_trivial.pass.cpp
===================================================================
--- libcxx/trunk/test/libcxx/utilities/tuple/tuple.tuple/tuple.cnstr/empty_tuple_trivial.pass.cpp
+++ libcxx/trunk/test/libcxx/utilities/tuple/tuple.tuple/tuple.cnstr/empty_tuple_trivial.pass.cpp
@@ -0,0 +1,22 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// This test ensures that std::tuple<> is trivially constructible. That is not
+// required by the Standard, but libc++ provides that guarantee.
+
+// UNSUPPORTED: c++98, c++03
+
+#include <tuple>
+#include <type_traits>
+
+
+static_assert(std::is_trivially_constructible<std::tuple<>>::value, "");
+
+int main(int, char**) {
+  return 0;
+}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62618.204074.patch
Type: text/x-patch
Size: 1546 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20190611/0ecd9d62/attachment.bin>


More information about the libcxx-commits mailing list