From: Eric Fiselier Date: Thu, 17 Jul 2014 05:31:31 +0000 (+0000) Subject: [libcxx] Add header for LFTS. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=531d8b2bc41f6b61bb2ff5c8b4fef1aa6703211a;p=platform%2Fupstream%2Fllvm.git [libcxx] Add header for LFTS. Summary: This patch adds the `` header as specified in the latest draft of the library fundamentals TS. `` 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 `` 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 llvm-svn: 213226 --- diff --git a/libcxx/include/experimental/utility b/libcxx/include/experimental/utility new file mode 100644 index 0000000..12a7d05 --- /dev/null +++ b/libcxx/include/experimental/utility @@ -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 + +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 + +#if _LIBCPP_STD_VER > 11 + +# include + +_LIBCPP_BEGIN_NAMESPACE_LFTS + + struct _LIBCPP_TYPE_VIS_ONLY erased_type { }; + +_LIBCPP_END_NAMESPACE_LFTS + +#endif /* _LIBCPP_STD_VER > 11 */ + +#endif /* _LIBCPP_EXPERIMENTAL_UTILITY */ diff --git a/libcxx/test/experimental/utilities/nothing_to_do.pass.cpp b/libcxx/test/experimental/utilities/nothing_to_do.pass.cpp new file mode 100644 index 0000000..9a59227 --- /dev/null +++ b/libcxx/test/experimental/utilities/nothing_to_do.pass.cpp @@ -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() +{ +} diff --git a/libcxx/test/experimental/utilities/utility/utility.erased.type/erased_type.pass.cpp b/libcxx/test/experimental/utilities/utility/utility.erased.type/erased_type.pass.cpp new file mode 100644 index 0000000..5f89e53 --- /dev/null +++ b/libcxx/test/experimental/utilities/utility/utility.erased.type/erased_type.pass.cpp @@ -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. +// +//===----------------------------------------------------------------------===// + +// + +#include + +int main() +{ +#if _LIBCPP_STD_VER > 11 + using std::experimental::erased_type; + constexpr erased_type e{}; +#endif +} diff --git a/libcxx/test/experimental/utilities/utility/utility.synop/includes.pass.cpp b/libcxx/test/experimental/utilities/utility/utility.synop/includes.pass.cpp new file mode 100644 index 0000000..bcdd8b3 --- /dev/null +++ b/libcxx/test/experimental/utilities/utility/utility.synop/includes.pass.cpp @@ -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. +// +//===----------------------------------------------------------------------===// + +// + +#include + +int main() +{ +#if _LIBCPP_STD_VER > 11 +# ifndef _LIBCPP_UTILITY +# error " must include " +# endif +#endif /* _LIBCPP_STD_VER > 11 */ +} diff --git a/libcxx/test/experimental/utilities/utility/version.pass.cpp b/libcxx/test/experimental/utilities/utility/version.pass.cpp new file mode 100644 index 0000000..4377124 --- /dev/null +++ b/libcxx/test/experimental/utilities/utility/version.pass.cpp @@ -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. +// +//===----------------------------------------------------------------------===// + +// + +#include + +#ifndef _LIBCPP_VERSION +#error _LIBCPP_VERSION not defined +#endif + +int main() +{ +} diff --git a/libcxx/www/ts1z_status.html b/libcxx/www/ts1z_status.html index c06ef7b..3a15770 100644 --- a/libcxx/www/ts1z_status.html +++ b/libcxx/www/ts1z_status.html @@ -59,7 +59,7 @@ Additions to std::promiseNot started Additions to std::packaged_taskNot started - Class erased_typeNot started + Class erased_typeInitial implementation complete Calling a function with a tuple of argumentsNot started Other type transformationsNot started Compile-time Rational ArithmeticNot started