[libcxx] r213226 - [libcxx] Add <experimental/utility> header for LFTS.
Eric Fiselier
eric at efcs.ca
Wed Jul 16 22:31:32 PDT 2014
Author: ericwf
Date: Thu Jul 17 00:31:31 2014
New Revision: 213226
URL: http://llvm.org/viewvc/llvm-project?rev=213226&view=rev
Log:
[libcxx] Add <experimental/utility> header for LFTS.
Summary:
This patch adds the `<experimental/utility>` header as specified in the latest draft of the library fundamentals TS.
`<experimental/utility>` only contains `class erased_type`.
This patch also updates the documentation to list the `erased_type` class as "initial implementation complete".
Test Plan:
Three test cases where added:
1. Test that `_LIBCPP_VERSION` is defined.
2. Test that `<utility>` has been included.
3. Test that `erased_type` is in the correct namespace and is constexpr default constructible.
Reviewers: mclow.lists
Reviewed By: mclow.lists
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D4510
Added:
libcxx/trunk/include/experimental/utility
libcxx/trunk/test/experimental/utilities/
libcxx/trunk/test/experimental/utilities/nothing_to_do.pass.cpp
libcxx/trunk/test/experimental/utilities/utility/
libcxx/trunk/test/experimental/utilities/utility/utility.erased.type/
libcxx/trunk/test/experimental/utilities/utility/utility.erased.type/erased_type.pass.cpp
libcxx/trunk/test/experimental/utilities/utility/utility.synop/
libcxx/trunk/test/experimental/utilities/utility/utility.synop/includes.pass.cpp
libcxx/trunk/test/experimental/utilities/utility/version.pass.cpp
Modified:
libcxx/trunk/www/ts1z_status.html
Added: libcxx/trunk/include/experimental/utility
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/experimental/utility?rev=213226&view=auto
==============================================================================
--- libcxx/trunk/include/experimental/utility (added)
+++ libcxx/trunk/include/experimental/utility Thu Jul 17 00:31:31 2014
@@ -0,0 +1,48 @@
+// -*- C++ -*-
+//===-------------------------- utility ----------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_EXPERIMENTAL_UTILITY
+#define _LIBCPP_EXPERIMENTAL_UTILITY
+
+/*
+ experimental/utility synopsis
+
+// C++1y
+
+#include <utility>
+
+namespace std {
+namespace experimental {
+inline namespace fundamentals_v1 {
+
+ 3.1.2, erased-type placeholder
+ struct erased_type { };
+
+} // namespace fundamentals_v1
+} // namespace experimental
+} // namespace std
+
+ */
+
+# include <experimental/__config>
+
+#if _LIBCPP_STD_VER > 11
+
+# include <utility>
+
+_LIBCPP_BEGIN_NAMESPACE_LFTS
+
+ struct _LIBCPP_TYPE_VIS_ONLY erased_type { };
+
+_LIBCPP_END_NAMESPACE_LFTS
+
+#endif /* _LIBCPP_STD_VER > 11 */
+
+#endif /* _LIBCPP_EXPERIMENTAL_UTILITY */
Added: libcxx/trunk/test/experimental/utilities/nothing_to_do.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/experimental/utilities/nothing_to_do.pass.cpp?rev=213226&view=auto
==============================================================================
--- libcxx/trunk/test/experimental/utilities/nothing_to_do.pass.cpp (added)
+++ libcxx/trunk/test/experimental/utilities/nothing_to_do.pass.cpp Thu Jul 17 00:31:31 2014
@@ -0,0 +1,13 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+int main()
+{
+}
Added: libcxx/trunk/test/experimental/utilities/utility/utility.erased.type/erased_type.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/experimental/utilities/utility/utility.erased.type/erased_type.pass.cpp?rev=213226&view=auto
==============================================================================
--- libcxx/trunk/test/experimental/utilities/utility/utility.erased.type/erased_type.pass.cpp (added)
+++ libcxx/trunk/test/experimental/utilities/utility/utility.erased.type/erased_type.pass.cpp Thu Jul 17 00:31:31 2014
@@ -0,0 +1,20 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <experimental/utility>
+
+#include <experimental/utility>
+
+int main()
+{
+#if _LIBCPP_STD_VER > 11
+ using std::experimental::erased_type;
+ constexpr erased_type e{};
+#endif
+}
Added: libcxx/trunk/test/experimental/utilities/utility/utility.synop/includes.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/experimental/utilities/utility/utility.synop/includes.pass.cpp?rev=213226&view=auto
==============================================================================
--- libcxx/trunk/test/experimental/utilities/utility/utility.synop/includes.pass.cpp (added)
+++ libcxx/trunk/test/experimental/utilities/utility/utility.synop/includes.pass.cpp Thu Jul 17 00:31:31 2014
@@ -0,0 +1,21 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <experimental/utility>
+
+#include <experimental/utility>
+
+int main()
+{
+#if _LIBCPP_STD_VER > 11
+# ifndef _LIBCPP_UTILITY
+# error "<experimental/utility> must include <utility>"
+# endif
+#endif /* _LIBCPP_STD_VER > 11 */
+}
Added: libcxx/trunk/test/experimental/utilities/utility/version.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/experimental/utilities/utility/version.pass.cpp?rev=213226&view=auto
==============================================================================
--- libcxx/trunk/test/experimental/utilities/utility/version.pass.cpp (added)
+++ libcxx/trunk/test/experimental/utilities/utility/version.pass.cpp Thu Jul 17 00:31:31 2014
@@ -0,0 +1,20 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <experimental/utility>
+
+#include <experimental/utility>
+
+#ifndef _LIBCPP_VERSION
+#error _LIBCPP_VERSION not defined
+#endif
+
+int main()
+{
+}
Modified: libcxx/trunk/www/ts1z_status.html
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/www/ts1z_status.html?rev=213226&r1=213225&r2=213226&view=diff
==============================================================================
--- libcxx/trunk/www/ts1z_status.html (original)
+++ libcxx/trunk/www/ts1z_status.html Thu Jul 17 00:31:31 2014
@@ -59,7 +59,7 @@
<tr><td>Additions to std::promise</td><td>Not started</td></tr>
<tr><td>Additions to std::packaged_task</td><td>Not started</td></tr>
<tr><td></td><td></td></tr>
- <tr><td>Class erased_type</td><td>Not started</td></tr>
+ <tr><td>Class erased_type</td><td>Initial implementation complete</td></tr>
<tr><td>Calling a function with a tuple of arguments</td><td>Not started</td></tr>
<tr><td>Other type transformations</td><td>Not started</td></tr>
<tr><td>Compile-time Rational Arithmetic</td><td>Not started</td></tr>
More information about the cfe-commits
mailing list