]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Make more internal headers include their own dependencies
authorJonathan Wakely <jwakely@redhat.com>
Fri, 16 Sep 2022 09:49:54 +0000 (10:49 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Fri, 16 Sep 2022 20:23:24 +0000 (21:23 +0100)
This adds required headers to a few internal headers that currently
assume their deps will be included first. It's more robust to make them
include their own dependencies, so that later refactoring or reuse of
those headers in new contexts doesn't break.

libstdc++-v3/ChangeLog:

* include/bits/stl_algo.h: Include <bits/stl_algobase.h>.
* include/bits/stl_tempbuf.h: Include headers for __try and
__catch macros, std::pair, and __gnu_cxx::__numeric_traits.
* include/bits/stream_iterator.h: Include <iosfwd> and headers
for std::addressof and std::iterator.
* include/bits/streambuf_iterator.h: Include header for
std::iterator.
* include/std/iterator: Do not include <iosfwd>.

libstdc++-v3/include/bits/stl_algo.h
libstdc++-v3/include/bits/stl_tempbuf.h
libstdc++-v3/include/bits/stream_iterator.h
libstdc++-v3/include/bits/streambuf_iterator.h
libstdc++-v3/include/std/iterator

index 57fa1c1dc55171dbf39d634ae019cdcc26bb800b..9cb708ab2fd63b9c22876fe018fa657903fd19a7 100644 (file)
@@ -57,6 +57,7 @@
 #define _STL_ALGO_H 1
 
 #include <bits/algorithmfwd.h>
+#include <bits/stl_algobase.h>
 #include <bits/stl_heap.h>
 #include <bits/stl_tempbuf.h>  // for _Temporary_buffer
 #include <bits/predefined_ops.h>
index 82f2dc8055fb354643148841f27a7ab62b78d1a6..b13aa3b0fccbaa8ece9287cfe796fb764e6335d0 100644 (file)
 #define _STL_TEMPBUF_H 1
 
 #include <new>
-#include <bits/stl_algobase.h>
+#include <bits/exception_defines.h>
 #include <bits/stl_construct.h>
+#include <bits/stl_pair.h>
+#include <ext/numeric_traits.h>
 
 namespace std _GLIBCXX_VISIBILITY(default)
 {
index 86c5845b8355ef640ad179b7b79527f0dc718384..0a1362a2eea7bf95b01ae545d66238b63e0d791c 100644 (file)
@@ -32,6 +32,9 @@
 
 #pragma GCC system_header
 
+#include <iosfwd>
+#include <bits/move.h>
+#include <bits/stl_iterator_base_types.h>
 #include <debug/debug.h>
 
 namespace std _GLIBCXX_VISIBILITY(default)
index 72344c630880243b7a65cb3a8e6ed8ac74478d93..c26ac249e01d9b1760695186fb10ee07ccfdaf0f 100644 (file)
@@ -33,6 +33,7 @@
 #pragma GCC system_header
 
 #include <streambuf>
+#include <bits/stl_iterator_base_types.h>
 #include <debug/debug.h>
 
 namespace std _GLIBCXX_VISIBILITY(default)
index 7f8fc50b39d25e866fef017df0684bdc183e5a92..2da2fb6e4a3a3d8eaa4b01984033e6315f97d930 100644 (file)
@@ -61,7 +61,6 @@
 #include <bits/stl_iterator_base_types.h>
 #include <bits/stl_iterator_base_funcs.h>
 #include <bits/stl_iterator.h>
-#include <iosfwd>
 #include <bits/stream_iterator.h>
 #include <bits/streambuf_iterator.h>
 #include <bits/range_access.h>