Avoid unnecessary inclusion of <stdexcept> header
authorJonathan Wakely <jwakely@redhat.com>
Thu, 6 Jun 2019 15:34:56 +0000 (16:34 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Thu, 6 Jun 2019 15:34:56 +0000 (16:34 +0100)
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

libstdc++-v3/ChangeLog
libstdc++-v3/include/std/array
libstdc++-v3/include/std/optional
libstdc++-v3/testsuite/20_util/function_objects/searchers.cc
libstdc++-v3/testsuite/20_util/tuple/cons/deduction.cc
libstdc++-v3/testsuite/23_containers/map/erasure.cc
libstdc++-v3/testsuite/23_containers/unordered_map/erasure.cc

index f1294f0..39f8b0e 100644 (file)
@@ -1,5 +1,15 @@
 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
        dg-prune-output for different C++98 diagnostic.
        * testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc:
index 02c6f4b..230e2b0 100644 (file)
@@ -36,7 +36,7 @@
 #else
 
 #include <utility>
-#include <stdexcept>
+#include <bits/functexcept.h>
 #include <bits/stl_algobase.h>
 #include <bits/range_access.h>
 
index ae825d3..79cd6c9 100644 (file)
 
 #include <utility>
 #include <type_traits>
-#include <stdexcept>
+#include <exception>
 #include <new>
 #include <initializer_list>
-#include <bits/functexcept.h>
+#include <bits/exception_defines.h>
 #include <bits/functional_hash.h>
 #include <bits/enable_special_members.h>
 
index aae21d2..fc27886 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <functional>
 #include <cstring>
+#include <cctype>
 #ifdef _GLIBCXX_USE_WCHAR_T
 # include <cwchar>
 #endif
index fa91f8f..eb3f2f3 100644 (file)
@@ -19,6 +19,7 @@
 // <http://www.gnu.org/licenses/>.
 
 #include <tuple>
+#include <memory>
 
 template<typename T, typename U> struct require_same;
 template<typename T> struct require_same<T, T> { using type = void; };
index d8a5716..5b211c3 100644 (file)
@@ -19,6 +19,7 @@
 // <http://www.gnu.org/licenses/>.
 
 #include <map>
+#include <string>
 #include <testsuite_hooks.h>
 
 #ifndef __cpp_lib_erase_if
index 35190a0..17bb940 100644 (file)
@@ -19,6 +19,7 @@
 // <http://www.gnu.org/licenses/>.
 
 #include <unordered_map>
+#include <string>
 #include <testsuite_hooks.h>
 
 #ifndef __cpp_lib_erase_if