Commit c05986b9 by Jonathan Wakely Committed by Jonathan Wakely

Split <functional> into smaller pieces

	* include/Makefile.am: Add <bits/refwrap.h> and <bits/std_function.h>.
	Order alphabetically.
	* include/Makefile.in: Regenerate.
	* include/bits/refwrap.h: New header.
	(_Maybe_get_result_type,_Weak_result_type_impl, _Weak_result_type)
	(_Reference_wrapper_base_impl, _Reference_wrapper_base)
	(reference_wrapper, ref, cref): Move here from <functional>.
	* include/bits/shared_ptr_base.h: Include <bits/refwrap.h> and
	<bits/stl_function.h> instead of <functional>.
	* include/bits/std_function.h: New header.
	(_Maybe_unary_or_binary_function, bad_function_call)
	(__is_location_invariant, _Nocopy_types, _Any_data)
	(_Simple_type_wrapper, _Function_base, _Function_handler, function):
	Move here from <functional>.
	* include/bits/unique_ptr.h: Include <bits/stl_function.h>.
	* include/std/functional: Include new headers and move components to
	them.
	* include/std/future: Include <bits/std_function.h> instead of
	<functional>.
	* include/std/mutex: Likewise.
	* include/std/regex: Likewise.
	* src/c++11/compatibility-thread-c++0x.cc: Include <functional>.
	* testsuite/20_util/default_delete/48631_neg.cc: Adjust dg-error line.
	* testsuite/20_util/default_delete/void_neg.cc: Likewise.
	* testsuite/20_util/unique_ptr/assign/48635_neg.cc: Adjust dg-error
	lines.
	* testsuite/20_util/unique_ptr/cons/cv_qual_neg.cc: Likewise.
	* testsuite/30_threads/packaged_task/49668.cc: Include <functional>.

From-SVN: r241410
parent 75a434a9
2016-10-21 Jonathan Wakely <jwakely@redhat.com> 2016-10-21 Jonathan Wakely <jwakely@redhat.com>
* include/Makefile.am: Add <bits/refwrap.h> and <bits/std_function.h>.
Order alphabetically.
* include/Makefile.in: Regenerate.
* include/bits/refwrap.h: New header.
(_Maybe_get_result_type,_Weak_result_type_impl, _Weak_result_type)
(_Reference_wrapper_base_impl, _Reference_wrapper_base)
(reference_wrapper, ref, cref): Move here from <functional>.
* include/bits/shared_ptr_base.h: Include <bits/refwrap.h> and
<bits/stl_function.h> instead of <functional>.
* include/bits/std_function.h: New header.
(_Maybe_unary_or_binary_function, bad_function_call)
(__is_location_invariant, _Nocopy_types, _Any_data)
(_Simple_type_wrapper, _Function_base, _Function_handler, function):
Move here from <functional>.
* include/bits/unique_ptr.h: Include <bits/stl_function.h>.
* include/std/functional: Include new headers and move components to
them.
* include/std/future: Include <bits/std_function.h> instead of
<functional>.
* include/std/mutex: Likewise.
* include/std/regex: Likewise.
* src/c++11/compatibility-thread-c++0x.cc: Include <functional>.
* testsuite/20_util/default_delete/48631_neg.cc: Adjust dg-error line.
* testsuite/20_util/default_delete/void_neg.cc: Likewise.
* testsuite/20_util/unique_ptr/assign/48635_neg.cc: Adjust dg-error
lines.
* testsuite/20_util/unique_ptr/cons/cv_qual_neg.cc: Likewise.
* testsuite/30_threads/packaged_task/49668.cc: Include <functional>.
* libsupc++/exception_ptr.h (make_exception_ptr): Qualify new. * libsupc++/exception_ptr.h (make_exception_ptr): Qualify new.
* testsuite/18_support/exception_ptr/make_exception_ptr_2.cc: New * testsuite/18_support/exception_ptr/make_exception_ptr_2.cc: New
test. test.
...@@ -3582,6 +3611,7 @@ ...@@ -3582,6 +3611,7 @@
* include/std/future: Include <functional>. * include/std/future: Include <functional>.
* include/std/memory: Do not include <functional>. * include/std/memory: Do not include <functional>.
* include/std/mutex: [_GLIBCXX_HAVE_TLS]: Likewise. * include/std/mutex: [_GLIBCXX_HAVE_TLS]: Likewise.
* src/c++11/compatibility-thread-c++0x.cc: Include <functional>.
* testsuite/20_util/shared_ptr/thread/default_weaktoshared.cc: Add * testsuite/20_util/shared_ptr/thread/default_weaktoshared.cc: Add
missing includes. missing includes.
* testsuite/20_util/shared_ptr/thread/mutex_weaktoshared.cc: Likewise. * testsuite/20_util/shared_ptr/thread/mutex_weaktoshared.cc: Likewise.
......
...@@ -140,6 +140,7 @@ bits_headers = \ ...@@ -140,6 +140,7 @@ bits_headers = \
${bits_srcdir}/random.h \ ${bits_srcdir}/random.h \
${bits_srcdir}/random.tcc \ ${bits_srcdir}/random.tcc \
${bits_srcdir}/range_access.h \ ${bits_srcdir}/range_access.h \
${bits_srcdir}/refwrap.h \
${bits_srcdir}/regex.h \ ${bits_srcdir}/regex.h \
${bits_srcdir}/regex.tcc \ ${bits_srcdir}/regex.tcc \
${bits_srcdir}/regex_constants.h \ ${bits_srcdir}/regex_constants.h \
...@@ -152,14 +153,13 @@ bits_headers = \ ...@@ -152,14 +153,13 @@ bits_headers = \
${bits_srcdir}/regex_compiler.tcc \ ${bits_srcdir}/regex_compiler.tcc \
${bits_srcdir}/regex_executor.h \ ${bits_srcdir}/regex_executor.h \
${bits_srcdir}/regex_executor.tcc \ ${bits_srcdir}/regex_executor.tcc \
${bits_srcdir}/stream_iterator.h \
${bits_srcdir}/streambuf_iterator.h \
${bits_srcdir}/shared_ptr.h \ ${bits_srcdir}/shared_ptr.h \
${bits_srcdir}/shared_ptr_atomic.h \ ${bits_srcdir}/shared_ptr_atomic.h \
${bits_srcdir}/shared_ptr_base.h \ ${bits_srcdir}/shared_ptr_base.h \
${bits_srcdir}/slice_array.h \ ${bits_srcdir}/slice_array.h \
${bits_srcdir}/sstream.tcc \ ${bits_srcdir}/sstream.tcc \
${bits_srcdir}/std_abs.h \ ${bits_srcdir}/std_abs.h \
${bits_srcdir}/std_function.h \
${bits_srcdir}/std_mutex.h \ ${bits_srcdir}/std_mutex.h \
${bits_srcdir}/stl_algo.h \ ${bits_srcdir}/stl_algo.h \
${bits_srcdir}/stl_algobase.h \ ${bits_srcdir}/stl_algobase.h \
...@@ -186,6 +186,8 @@ bits_headers = \ ...@@ -186,6 +186,8 @@ bits_headers = \
${bits_srcdir}/stl_tree.h \ ${bits_srcdir}/stl_tree.h \
${bits_srcdir}/stl_uninitialized.h \ ${bits_srcdir}/stl_uninitialized.h \
${bits_srcdir}/stl_vector.h \ ${bits_srcdir}/stl_vector.h \
${bits_srcdir}/stream_iterator.h \
${bits_srcdir}/streambuf_iterator.h \
${bits_srcdir}/streambuf.tcc \ ${bits_srcdir}/streambuf.tcc \
${bits_srcdir}/stringfwd.h \ ${bits_srcdir}/stringfwd.h \
${bits_srcdir}/string_view.tcc \ ${bits_srcdir}/string_view.tcc \
......
...@@ -431,6 +431,7 @@ bits_headers = \ ...@@ -431,6 +431,7 @@ bits_headers = \
${bits_srcdir}/random.h \ ${bits_srcdir}/random.h \
${bits_srcdir}/random.tcc \ ${bits_srcdir}/random.tcc \
${bits_srcdir}/range_access.h \ ${bits_srcdir}/range_access.h \
${bits_srcdir}/refwrap.h \
${bits_srcdir}/regex.h \ ${bits_srcdir}/regex.h \
${bits_srcdir}/regex.tcc \ ${bits_srcdir}/regex.tcc \
${bits_srcdir}/regex_constants.h \ ${bits_srcdir}/regex_constants.h \
...@@ -443,14 +444,13 @@ bits_headers = \ ...@@ -443,14 +444,13 @@ bits_headers = \
${bits_srcdir}/regex_compiler.tcc \ ${bits_srcdir}/regex_compiler.tcc \
${bits_srcdir}/regex_executor.h \ ${bits_srcdir}/regex_executor.h \
${bits_srcdir}/regex_executor.tcc \ ${bits_srcdir}/regex_executor.tcc \
${bits_srcdir}/stream_iterator.h \
${bits_srcdir}/streambuf_iterator.h \
${bits_srcdir}/shared_ptr.h \ ${bits_srcdir}/shared_ptr.h \
${bits_srcdir}/shared_ptr_atomic.h \ ${bits_srcdir}/shared_ptr_atomic.h \
${bits_srcdir}/shared_ptr_base.h \ ${bits_srcdir}/shared_ptr_base.h \
${bits_srcdir}/slice_array.h \ ${bits_srcdir}/slice_array.h \
${bits_srcdir}/sstream.tcc \ ${bits_srcdir}/sstream.tcc \
${bits_srcdir}/std_abs.h \ ${bits_srcdir}/std_abs.h \
${bits_srcdir}/std_function.h \
${bits_srcdir}/std_mutex.h \ ${bits_srcdir}/std_mutex.h \
${bits_srcdir}/stl_algo.h \ ${bits_srcdir}/stl_algo.h \
${bits_srcdir}/stl_algobase.h \ ${bits_srcdir}/stl_algobase.h \
...@@ -477,6 +477,8 @@ bits_headers = \ ...@@ -477,6 +477,8 @@ bits_headers = \
${bits_srcdir}/stl_tree.h \ ${bits_srcdir}/stl_tree.h \
${bits_srcdir}/stl_uninitialized.h \ ${bits_srcdir}/stl_uninitialized.h \
${bits_srcdir}/stl_vector.h \ ${bits_srcdir}/stl_vector.h \
${bits_srcdir}/stream_iterator.h \
${bits_srcdir}/streambuf_iterator.h \
${bits_srcdir}/streambuf.tcc \ ${bits_srcdir}/streambuf.tcc \
${bits_srcdir}/stringfwd.h \ ${bits_srcdir}/stringfwd.h \
${bits_srcdir}/string_view.tcc \ ${bits_srcdir}/string_view.tcc \
......
...@@ -49,11 +49,12 @@ ...@@ -49,11 +49,12 @@
#ifndef _SHARED_PTR_BASE_H #ifndef _SHARED_PTR_BASE_H
#define _SHARED_PTR_BASE_H 1 #define _SHARED_PTR_BASE_H 1
#include <functional>
#if __cpp_rtti #if __cpp_rtti
# include <typeinfo> # include <typeinfo>
#endif #endif
#include <bits/allocated_ptr.h> #include <bits/allocated_ptr.h>
#include <bits/refwrap.h>
#include <bits/stl_function.h>
#include <ext/aligned_buffer.h> #include <ext/aligned_buffer.h>
namespace std _GLIBCXX_VISIBILITY(default) namespace std _GLIBCXX_VISIBILITY(default)
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include <type_traits> #include <type_traits>
#include <utility> #include <utility>
#include <tuple> #include <tuple>
#include <bits/stl_function.h>
namespace std _GLIBCXX_VISIBILITY(default) namespace std _GLIBCXX_VISIBILITY(default)
{ {
......
...@@ -40,12 +40,12 @@ ...@@ -40,12 +40,12 @@
#include <condition_variable> #include <condition_variable>
#include <system_error> #include <system_error>
#include <atomic> #include <atomic>
#include <functional>
#include <bits/atomic_futex.h> #include <bits/atomic_futex.h>
#include <bits/functexcept.h> #include <bits/functexcept.h>
#include <bits/invoke.h> #include <bits/invoke.h>
#include <bits/unique_ptr.h> #include <bits/unique_ptr.h>
#include <bits/shared_ptr.h> #include <bits/shared_ptr.h>
#include <bits/std_function.h>
#include <bits/uses_allocator.h> #include <bits/uses_allocator.h>
#include <bits/allocated_ptr.h> #include <bits/allocated_ptr.h>
#include <ext/aligned_buffer.h> #include <ext/aligned_buffer.h>
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
# include <thread> # include <thread>
#endif #endif
#ifndef _GLIBCXX_HAVE_TLS #ifndef _GLIBCXX_HAVE_TLS
# include <functional> # include <bits/std_function.h>
#endif #endif
#ifdef _GLIBCXX_USE_C99_STDINT_TR1 #ifdef _GLIBCXX_USE_C99_STDINT_TR1
......
...@@ -37,7 +37,6 @@ ...@@ -37,7 +37,6 @@
#include <algorithm> #include <algorithm>
#include <bitset> #include <bitset>
#include <functional>
#ifdef _GLIBCXX_DEBUG #ifdef _GLIBCXX_DEBUG
# include <iosfwd> # include <iosfwd>
#endif #endif
...@@ -54,6 +53,7 @@ ...@@ -54,6 +53,7 @@
#include <cstring> #include <cstring>
#include <ext/aligned_buffer.h> #include <ext/aligned_buffer.h>
#include <bits/std_function.h>
#include <bits/regex_constants.h> #include <bits/regex_constants.h>
#include <bits/regex_error.h> #include <bits/regex_error.h>
#include <bits/regex_automaton.h> #include <bits/regex_automaton.h>
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <future> #include <future>
#include <mutex> #include <mutex>
#include <functional>
#if __cplusplus < 201103L #if __cplusplus < 201103L
# error "compatibility-thread-c++0x.cc must be compiled with -std=gnu++0x" # error "compatibility-thread-c++0x.cc must be compiled with -std=gnu++0x"
......
...@@ -26,4 +26,4 @@ struct D : B { }; ...@@ -26,4 +26,4 @@ struct D : B { };
D d; D d;
std::default_delete<B[]> db; std::default_delete<B[]> db;
typedef decltype(db(&d)) type; // { dg-error "no match" } typedef decltype(db(&d)) type; // { dg-error "no match" }
// { dg-error "no type" "" { target *-*-* } 106 } // { dg-error "no type" "" { target *-*-* } 107 }
...@@ -25,5 +25,5 @@ void test01() ...@@ -25,5 +25,5 @@ void test01()
{ {
std::default_delete<void> d; std::default_delete<void> d;
d(nullptr); // { dg-error "here" } d(nullptr); // { dg-error "here" }
// { dg-error "incomplete" "" { target *-*-* } 72 } // { dg-error "incomplete" "" { target *-*-* } 73 }
} }
...@@ -42,10 +42,10 @@ void f() ...@@ -42,10 +42,10 @@ void f()
std::unique_ptr<int, D&> ud(nullptr, d); std::unique_ptr<int, D&> ud(nullptr, d);
ub = std::move(ud); // { dg-error "no match" } ub = std::move(ud); // { dg-error "no match" }
ub2 = ud; // { dg-error "no match" } ub2 = ud; // { dg-error "no match" }
// { dg-error "no type" "" { target *-*-* } 287 } // { dg-error "no type" "" { target *-*-* } 288 }
std::unique_ptr<int[], B&> uba(nullptr, b); std::unique_ptr<int[], B&> uba(nullptr, b);
std::unique_ptr<int[], D&> uda(nullptr, d); std::unique_ptr<int[], D&> uda(nullptr, d);
uba = std::move(uda); // { dg-error "no match" } uba = std::move(uda); // { dg-error "no match" }
// { dg-error "no type" "" { target *-*-* } 538 } // { dg-error "no type" "" { target *-*-* } 539 }
} }
...@@ -39,7 +39,7 @@ test07() ...@@ -39,7 +39,7 @@ test07()
std::unique_ptr<const A[]> cA3(p); // { dg-error "no matching function" } std::unique_ptr<const A[]> cA3(p); // { dg-error "no matching function" }
std::unique_ptr<volatile A[]> vA3(p); // { dg-error "no matching function" } std::unique_ptr<volatile A[]> vA3(p); // { dg-error "no matching function" }
std::unique_ptr<const volatile A[]> cvA3(p); // { dg-error "no matching function" } std::unique_ptr<const volatile A[]> cvA3(p); // { dg-error "no matching function" }
// { dg-error "no type" "" { target *-*-* } 446 } // { dg-error "no type" "" { target *-*-* } 447 }
} }
template<typename T> template<typename T>
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <future> #include <future>
#include <functional>
#include <testsuite_hooks.h> #include <testsuite_hooks.h>
struct moveable struct moveable
......
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