Avoid unnecessary inclusion of <stdexcept> header

This can greatly reduce the amount of preprocessed code that is included
by other headers, because <stdexcept> depends on <string> which is huge.

	* include/std/array: Do not include <stdexcept>.
	* include/std/optional: Include <exception> and
	<bits/exception_defines.h> instead of <stdexcept>.
	* testsuite/20_util/function_objects/searchers.cc: Include <cctype>
	for std::isalnum.
	* testsuite/20_util/tuple/cons/deduction.cc: Include <memory> for
	std::allocator.
	* testsuite/23_containers/map/erasure.cc: Include <string>.
	* testsuite/23_containers/unordered_map/erasure.cc: Likewise.

From-SVN: r272011
This commit is contained in:
Jonathan Wakely 2019-06-06 16:34:56 +01:00 committed by Jonathan Wakely
parent ad60f42883
commit beb0086f59
7 changed files with 17 additions and 3 deletions

View File

@ -1,5 +1,15 @@
2019-06-06 Jonathan Wakely <jwakely@redhat.com> 2019-06-06 Jonathan Wakely <jwakely@redhat.com>
* include/std/array: Do not include <stdexcept>.
* include/std/optional: Include <exception> and
<bits/exception_defines.h> instead of <stdexcept>.
* testsuite/20_util/function_objects/searchers.cc: Include <cctype>
for std::isalnum.
* testsuite/20_util/tuple/cons/deduction.cc: Include <memory> for
std::allocator.
* testsuite/23_containers/map/erasure.cc: Include <string>.
* testsuite/23_containers/unordered_map/erasure.cc: Likewise.
* testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Add * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Add
dg-prune-output for different C++98 diagnostic. dg-prune-output for different C++98 diagnostic.
* testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc: * testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc:

View File

@ -36,7 +36,7 @@
#else #else
#include <utility> #include <utility>
#include <stdexcept> #include <bits/functexcept.h>
#include <bits/stl_algobase.h> #include <bits/stl_algobase.h>
#include <bits/range_access.h> #include <bits/range_access.h>

View File

@ -35,10 +35,10 @@
#include <utility> #include <utility>
#include <type_traits> #include <type_traits>
#include <stdexcept> #include <exception>
#include <new> #include <new>
#include <initializer_list> #include <initializer_list>
#include <bits/functexcept.h> #include <bits/exception_defines.h>
#include <bits/functional_hash.h> #include <bits/functional_hash.h>
#include <bits/enable_special_members.h> #include <bits/enable_special_members.h>

View File

@ -19,6 +19,7 @@
#include <functional> #include <functional>
#include <cstring> #include <cstring>
#include <cctype>
#ifdef _GLIBCXX_USE_WCHAR_T #ifdef _GLIBCXX_USE_WCHAR_T
# include <cwchar> # include <cwchar>
#endif #endif

View File

@ -19,6 +19,7 @@
// <http://www.gnu.org/licenses/>. // <http://www.gnu.org/licenses/>.
#include <tuple> #include <tuple>
#include <memory>
template<typename T, typename U> struct require_same; template<typename T, typename U> struct require_same;
template<typename T> struct require_same<T, T> { using type = void; }; template<typename T> struct require_same<T, T> { using type = void; };

View File

@ -19,6 +19,7 @@
// <http://www.gnu.org/licenses/>. // <http://www.gnu.org/licenses/>.
#include <map> #include <map>
#include <string>
#include <testsuite_hooks.h> #include <testsuite_hooks.h>
#ifndef __cpp_lib_erase_if #ifndef __cpp_lib_erase_if

View File

@ -19,6 +19,7 @@
// <http://www.gnu.org/licenses/>. // <http://www.gnu.org/licenses/>.
#include <unordered_map> #include <unordered_map>
#include <string>
#include <testsuite_hooks.h> #include <testsuite_hooks.h>
#ifndef __cpp_lib_erase_if #ifndef __cpp_lib_erase_if