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 f1294f0c05831d9c1dc4c65caa1b0b407b54c4cb..39f8b0e3575a1bed3d50cf6bb669d4eff0bd10a0 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 02c6f4b4dbe91d6a86280893f84cb720e4561728..230e2b0f59394f64b67cc59547a9ecbf4b8b7697 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 ae825d3e32755cb558a6836cc392b3cba061556e..79cd6c97019a99ddf3bd77c14b88d83067a2b1d4 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 aae21d28d3a07c73e9a8f90fd642428374efaee3..fc278860f5cba529318e849de6e08726a2a849a5 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <functional>
 #include <cstring>
+#include <cctype>
 #ifdef _GLIBCXX_USE_WCHAR_T
 # include <cwchar>
 #endif
index fa91f8fa5393dc33cd9c4547d83182dac92def39..eb3f2f3d6ab47bc62e99341eb514cc124476d93e 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 d8a57160865a757af79685257cb782c676cf4d05..5b211c3602b09320759956ea023a664ac53bf9c6 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 35190a0d19e81e098a35ca56b1c36a1c3a08ea05..17bb940f00f84e4ddd57c20b1653fbaec8260ffd 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