[PATCH] [PATCH] [gdb] adds `<iterator>` to list of includes

Simon Marchi simark@simark.ca
Sun Jul 10 18:52:48 GMT 2022


On 2022-07-09 04:54, Enze Li via Gdb-patches wrote:
> Hi Manoj,
> 
> On Fri, 2022-07-08 at 22:57 -0700, Manoj Gupta wrote:
>> I work on ChromeOS and can provide answers to this.
>>
>> <vector> does not include provide std::back_inserter as per C++ spec.
>> It is provided by <iterator> [1].
>> The fact that it worked so far is just an accident that libc++ and
>> libstdc++ were including this
>> header with <vector>.
>> With libc++, it is no longer true. See commit "[libc++] Removes
>> unneeded <iterator> includes." in libc++ [2].
>> It is therefore not surprising that gdb fails to build. 
> 
> Thank you for the detailed explanation.  It seems that we need to
> manually compile and install the libc++ from upstream before we can
> reproduce this issue.

This is trivial enough that it's not really necessary to reproduce to
get convinced that such a change would be good.  The file uses
back_inserter -> C++ says that back_inserter is provided by <iterator>
-> make the file include <iterator>.  This has no real change of
breaking anything.

Simon


More information about the Gdb-patches mailing list