Commit c2513a1f by Jonathan Wakely Committed by Jonathan Wakely

any: Add feature-testing macro.

	* include/experimental/any: Add feature-testing macro.
	* include/experimental/optional: Likewise.
	* include/experimental/string_view: Likewise.
	* include/experimental/tuple: Likewise.
	* include/experimental/type_traits: Likewise.
	* testsuite/experimental/any/misc/any_cast_neg.cc: Adjust dg-error.

From-SVN: r216848
parent 43e9f722
...@@ -12,6 +12,13 @@ ...@@ -12,6 +12,13 @@
* testsuite/experimental/functional/value.cc: New. * testsuite/experimental/functional/value.cc: New.
* testsuite/experimental/feat-lib-fund.cc: Add headers and reorder. * testsuite/experimental/feat-lib-fund.cc: Add headers and reorder.
* include/experimental/any: Add feature-testing macro.
* include/experimental/optional: Likewise.
* include/experimental/string_view: Likewise.
* include/experimental/tuple: Likewise.
* include/experimental/type_traits: Likewise.
* testsuite/experimental/any/misc/any_cast_neg.cc: Adjust dg-error.
2014-10-25 François Dumont <fdumont@gcc.gnu.org> 2014-10-25 François Dumont <fdumont@gcc.gnu.org>
* doc/xml/manual/status_cxx2011.xml: Update unordered container * doc/xml/manual/status_cxx2011.xml: Update unordered container
......
...@@ -60,6 +60,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -60,6 +60,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
* @{ * @{
*/ */
#define __cpp_lib_experimental_any 201402
/** /**
* @brief Exception class thrown by a failed @c any_cast * @brief Exception class thrown by a failed @c any_cast
* @ingroup exceptions * @ingroup exceptions
......
...@@ -67,6 +67,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -67,6 +67,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
* @{ * @{
*/ */
#define __cpp_lib_experimental_optional 201406
// All subsequent [X.Y.n] references are against n3793. // All subsequent [X.Y.n] references are against n3793.
// [X.Y.4] // [X.Y.4]
......
...@@ -50,6 +50,8 @@ inline namespace fundamentals_v1 ...@@ -50,6 +50,8 @@ inline namespace fundamentals_v1
{ {
_GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_BEGIN_NAMESPACE_VERSION
#define __cpp_lib_experimental_string_view 201402
/** /**
* @class basic_string_view <experimental/string_view> * @class basic_string_view <experimental/string_view>
* @brief A non-owning reference to a string. * @brief A non-owning reference to a string.
......
...@@ -44,10 +44,13 @@ namespace experimental ...@@ -44,10 +44,13 @@ namespace experimental
inline namespace fundamentals_v1 inline namespace fundamentals_v1
{ {
_GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_BEGIN_NAMESPACE_VERSION
// See C++14 §20.4.2.5, tuple helper classes // See C++14 §20.4.2.5, tuple helper classes
template <typename _Tp> template <typename _Tp>
constexpr size_t tuple_size_v = tuple_size<_Tp>::value; constexpr size_t tuple_size_v = tuple_size<_Tp>::value;
#define __cpp_lib_experimental_tuple 201402
template <typename _Fn, typename _Tuple, std::size_t... _Idx> template <typename _Fn, typename _Tuple, std::size_t... _Idx>
constexpr decltype(auto) constexpr decltype(auto)
__apply_impl(_Fn&& f, _Tuple&& t, std::index_sequence<_Idx...>) __apply_impl(_Fn&& f, _Tuple&& t, std::index_sequence<_Idx...>)
......
...@@ -50,6 +50,8 @@ inline namespace fundamentals_v1 ...@@ -50,6 +50,8 @@ inline namespace fundamentals_v1
{ {
_GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_BEGIN_NAMESPACE_VERSION
#define __cpp_lib_experimental_type_trait_variable_templates 201402
// See C++14 §20.10.4.1, primary type categories // See C++14 §20.10.4.1, primary type categories
template <typename _Tp> template <typename _Tp>
constexpr bool is_void_v = is_void<_Tp>::value; constexpr bool is_void_v = is_void<_Tp>::value;
......
...@@ -26,5 +26,5 @@ void test01() ...@@ -26,5 +26,5 @@ void test01()
using std::experimental::any_cast; using std::experimental::any_cast;
const any y(1); const any y(1);
any_cast<int&>(y); // { dg-error "qualifiers" "" { target { *-*-* } } 380 } any_cast<int&>(y); // { dg-error "qualifiers" "" { target { *-*-* } } 382 }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment