[libcxx-commits] [PATCH] D62618: [libcxx] Make std::tuple<> trivially constructible
Louis Dionne via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Thu May 30 10:33:56 PDT 2019
ldionne updated this revision to Diff 202236.
ldionne marked 2 inline comments as done.
ldionne added a comment.
Use = default per Eric's comment.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D62618/new/
https://reviews.llvm.org/D62618
Files:
libcxx/include/tuple
libcxx/test/libcxx/utilities/tuple/tuple.tuple/tuple.cnstr/empty_tuple_trivial.pass.cpp
Index: libcxx/test/libcxx/utilities/tuple/tuple.tuple/tuple.cnstr/empty_tuple_trivial.pass.cpp
===================================================================
--- /dev/null
+++ libcxx/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;
+}
Index: libcxx/include/tuple
===================================================================
--- libcxx/include/tuple
+++ libcxx/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 {}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62618.202236.patch
Type: text/x-patch
Size: 1432 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20190530/593e2f36/attachment.bin>
More information about the libcxx-commits
mailing list