]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Fix circular dependency for bitmap_allocator [PR103381]
authorJonathan Wakely <jwakely@redhat.com>
Tue, 23 Nov 2021 12:28:22 +0000 (12:28 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Tue, 23 Nov 2021 23:42:30 +0000 (23:42 +0000)
<ext/bitmap_allocator.h> includes <function>, and since C++17 that
includes <unordered_map>. If std::allocator is defined in terms of
__gnu_cxx::bitmap_allocator then you get a circular reference and
bootstrap fails when compiling src/c++17/*.cc.

libstdc++-v3/ChangeLog:

PR libstdc++/103381
* include/ext/bitmap_allocator.h: Include <bits/stl_function.h>
instead of <functional>.

(cherry picked from commit 5459fa132a99e6037e5ccf1b49d617677a584ff8)

libstdc++-v3/include/ext/bitmap_allocator.h

index edddf32fb973fea3f72d7343fb626a0c693536c6..7e34f97cdb7839d619a3aef4752d0345d1d26ae6 100644 (file)
@@ -31,7 +31,7 @@
 
 #include <utility> // For std::pair.
 #include <bits/functexcept.h> // For __throw_bad_alloc().
-#include <functional> // For greater_equal, and less_equal.
+#include <bits/stl_function.h> // For greater_equal, and less_equal.
 #include <new> // For operator new.
 #include <debug/debug.h> // _GLIBCXX_DEBUG_ASSERT
 #include <ext/concurrence.h>