modules : Make sure we include <map> in system.h.
authorIain Sandoe <iain@sandoe.co.uk>
Tue, 30 Mar 2021 13:56:39 +0000 (14:56 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Thu, 1 Apr 2021 18:32:16 +0000 (19:32 +0100)
commitaf78514a18ca5c9aaa10813bb4dc639d7ccdf0cc
tree7bd4a70961432d96ca9aa4661fb70209d26f0229
parent5f00df5925082c7b66da91270f2ed29bf4818c93
modules : Make sure we include <map> in system.h.

It appears that many targets include the map header transitively in
other std headers included from system.h.  However there are some
editions of clang/libc++ in Xcode that do not, which results in a
bootstrap fail - since when resolver.h is included  there is then a
conflict in declaring abort().

The fix is to ensure that map is pulled in by system.h and before
resolver.h is included.  As a precautionary measure and to alert
anyone perhaps adding another header to resolver.h this patch also
gates the direct includes there on !IN_GCC.

c++tools/ChangeLog:

* resolver.h: Do not include std headers directly when
building in GCC.

gcc/cp/ChangeLog:

* mapper-client.cc (INCLUDE_MAP): New; require map to be
included from system.h.
* mapper-resolver.cc (INCLUDE_MAP): Likewise.
c++tools/resolver.h
gcc/cp/mapper-client.cc
gcc/cp/mapper-resolver.cc