From 285ee2fb11d392e2991f5307e959faac5a8f0bce Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Fri, 19 Aug 2016 16:42:11 +0100 Subject: [PATCH] Fix ambiguities in C++17 mode * include/experimental/tuple (apply): Qualify call to __apply_impl. * include/std/tuple (apply): Likewise. * testsuite/experimental/system_error/value.cc: Fix ambiguities in C++17 mode. * testsuite/experimental/tuple/tuple_size.cc: Likewise. * testsuite/experimental/type_traits/value.cc: Likewise. From-SVN: r239621 --- libstdc++-v3/ChangeLog | 7 ++ libstdc++-v3/include/experimental/tuple | 5 +- libstdc++-v3/include/std/tuple | 5 +- .../experimental/system_error/value.cc | 14 ++-- .../experimental/tuple/tuple_size.cc | 5 +- .../experimental/type_traits/value.cc | 70 ++++++++++++++++++- 6 files changed, 92 insertions(+), 14 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index edcb835029c..2a3e6947304 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,12 @@ 2016-08-19 Jonathan Wakely + * include/experimental/tuple (apply): Qualify call to __apply_impl. + * include/std/tuple (apply): Likewise. + * testsuite/experimental/system_error/value.cc: Fix ambiguities in + C++17 mode. + * testsuite/experimental/tuple/tuple_size.cc: Likewise. + * testsuite/experimental/type_traits/value.cc: Likewise. + * doc/xml/manual/status_cxx2017.xml: Update status of make_from_tuple and variant. * doc/html/*: Regenerate. diff --git a/libstdc++-v3/include/experimental/tuple b/libstdc++-v3/include/experimental/tuple index bfa1ed18f9e..b653ea72e2a 100644 --- a/libstdc++-v3/include/experimental/tuple +++ b/libstdc++-v3/include/experimental/tuple @@ -66,8 +66,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { using _Indices = std::make_index_sequence>>; - return __apply_impl(std::forward<_Fn>(__f), std::forward<_Tuple>(__t), - _Indices{}); + return experimental::__apply_impl(std::forward<_Fn>(__f), + std::forward<_Tuple>(__t), + _Indices{}); } _GLIBCXX_END_NAMESPACE_VERSION diff --git a/libstdc++-v3/include/std/tuple b/libstdc++-v3/include/std/tuple index 29db833e700..c06a040a960 100644 --- a/libstdc++-v3/include/std/tuple +++ b/libstdc++-v3/include/std/tuple @@ -1652,8 +1652,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION apply(_Fn&& __f, _Tuple&& __t) { using _Indices = make_index_sequence>>; - return __apply_impl(std::forward<_Fn>(__f), std::forward<_Tuple>(__t), - _Indices{}); + return std::__apply_impl(std::forward<_Fn>(__f), + std::forward<_Tuple>(__t), + _Indices{}); } #define __cpp_lib_make_from_tuple 201606 diff --git a/libstdc++-v3/testsuite/experimental/system_error/value.cc b/libstdc++-v3/testsuite/experimental/system_error/value.cc index ee792cbdae6..3b346ce95fb 100644 --- a/libstdc++-v3/testsuite/experimental/system_error/value.cc +++ b/libstdc++-v3/testsuite/experimental/system_error/value.cc @@ -20,21 +20,23 @@ #include #include -using namespace std; -using namespace std::experimental; +using std::is_error_code_enum; +using std::is_error_condition_enum; +using std::experimental::is_error_code_enum_v; +using std::experimental::is_error_condition_enum_v; // These tests are rather simple, the front-end tests already test // variable templates, and the library tests for the underlying // traits are more elaborate. These are just simple sanity tests. -static_assert(is_error_code_enum_v - && is_error_code_enum::value, ""); +static_assert(is_error_code_enum_v + && is_error_code_enum::value, ""); static_assert(!is_error_code_enum_v && !is_error_code_enum::value, ""); -static_assert(is_error_condition_enum_v - && is_error_condition_enum::value, ""); +static_assert(is_error_condition_enum_v + && is_error_condition_enum::value, ""); static_assert(!is_error_condition_enum_v && !is_error_condition_enum::value, ""); diff --git a/libstdc++-v3/testsuite/experimental/tuple/tuple_size.cc b/libstdc++-v3/testsuite/experimental/tuple/tuple_size.cc index 953d3b2fb4a..e9a49ea037b 100644 --- a/libstdc++-v3/testsuite/experimental/tuple/tuple_size.cc +++ b/libstdc++-v3/testsuite/experimental/tuple/tuple_size.cc @@ -20,8 +20,9 @@ #include -using namespace std; -using namespace std::experimental; +using std::tuple; +using std::tuple_size; +using std::experimental::tuple_size_v; // These tests are rather simple, the front-end tests already test // variable templates, and the library tests for the underlying diff --git a/libstdc++-v3/testsuite/experimental/type_traits/value.cc b/libstdc++-v3/testsuite/experimental/type_traits/value.cc index 16b63cbf47b..6a7a95dc5e1 100644 --- a/libstdc++-v3/testsuite/experimental/type_traits/value.cc +++ b/libstdc++-v3/testsuite/experimental/type_traits/value.cc @@ -20,8 +20,74 @@ #include -using namespace std; -using namespace experimental; +using std::true_type; +using std::false_type; +using std::nullptr_t; +using std::is_void; +using std::is_null_pointer; +using std::is_integral; +using std::is_floating_point; +using std::is_array; +using std::is_pointer; +using std::is_lvalue_reference; +using std::is_rvalue_reference; +using std::is_member_object_pointer; +using std::is_member_function_pointer; +using std::is_enum; +using std::is_union; +using std::is_class; +using std::is_function; +using std::is_reference; +using std::is_arithmetic; +using std::is_fundamental; +using std::is_object; +using std::is_scalar; +using std::is_compound; +using std::is_member_pointer; +using std::is_const; +using std::is_volatile; +using std::is_trivial; +using std::is_trivially_copyable; +using std::is_standard_layout; +using std::is_pod; +using std::is_literal_type; +using std::is_empty; +using std::is_polymorphic; +using std::is_abstract; +using std::is_final; +using std::is_signed; +using std::is_constructible; +using std::is_default_constructible; +using std::is_copy_constructible; +using std::is_move_constructible; +using std::is_assignable; +using std::is_copy_assignable; +using std::is_move_assignable; +using std::is_destructible; +using std::is_trivially_constructible; +using std::is_trivially_default_constructible; +using std::is_trivially_copy_constructible; +using std::is_trivially_move_constructible; +using std::is_trivially_assignable; +using std::is_trivially_copy_assignable; +using std::is_trivially_move_assignable; +using std::is_trivially_destructible; +using std::is_nothrow_constructible; +using std::is_nothrow_default_constructible; +using std::is_nothrow_copy_constructible; +using std::is_nothrow_move_constructible; +using std::is_nothrow_assignable; +using std::is_nothrow_copy_assignable; +using std::is_nothrow_move_assignable; +using std::is_nothrow_destructible; +using std::has_virtual_destructor; +using std::alignment_of; +using std::rank; +using std::extent; +using std::is_same; +using std::is_base_of; +using std::is_convertible; +using namespace std::experimental; // These tests are rather simple, the front-end tests already test // variable templates, and the library tests for the underlying -- 2.30.2