This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Include <memory> from system.h (PR bootstrap/82610)
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: David Malcolm <dmalcolm at redhat dot com>
- Cc: Gerald Pfeifer <gerald at pfeifer dot com>, Pedro Alves <palves at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Trevor Saunders <tbsaunde+gcc at tbsaunde dot org>, Jonathan Wakely <jwakely at redhat dot com>
- Date: Mon, 23 Oct 2017 15:51:17 +0200
- Subject: Re: [PATCH] Include <memory> from system.h (PR bootstrap/82610)
- Authentication-results: sourceware.org; auth=none
- References: <1508763498-38147-1-git-send-email-dmalcolm@redhat.com>
On Mon, Oct 23, 2017 at 2:58 PM, David Malcolm <dmalcolm@redhat.com> wrote:
> On Sun, 2017-10-22 at 09:28 +0200, Gerald Pfeifer wrote:
>> On Thu, 19 Oct 2017, David Malcolm wrote:
>> > > In file included from /scratch/tmp/gerald/gcc-HEAD/gcc/unique-
>> > > ptr-tests.cc:23:
>> > > In file included from /scratch/tmp/gerald/gcc-
>> > > HEAD/gcc/../include/unique-ptr.h:77:
>> > > In file included from /usr/include/c++/v1/memory:629:
>> > > /usr/include/c++/v1/typeinfo:199:2: error: no member named
>> > > 'fancy_abort' in namespace 'std::__1'; did you mean simply
>> > > 'fancy_abort'?
>> > > _VSTD::abort();
>> > > ^~~~~~~
>> > > /usr/include/c++/v1/__config:390:15: note: expanded from macro
>> > > '_VSTD'
>> > > #define _VSTD std::_LIBCPP_NAMESPACE
>> >
>> > There seem to have been similar problems on OS X:
>> > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82610
>>
>> Yes, I believe it's the same actually (unearthed by clang as system
>> compiler).
>>
>> > The proposed fix there is to include <memory> in system.h, which
>> > presumably would fix this also.
>>
>> That appears to work around the bootstrap failure on my tester as
>> well.
>>
>> How can we go about fixing this in the tree?
>>
>> Gerald
>
> Here's the patch by fxcoudert from the PR (plus a ChangeLog entry)
>
> Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu;
> reported by fxcoudert as fixing the issue on darwin and by
> Gerald as fixing the issue on "newer versions of FreeBSD that use
> clang 4.0 as system compiler".
>
> OK for trunk?
Not entirely happy as unique-ptr.h doesn't use <memory> but well.
Ok to unbreak bootstrap.
Thanks,
Richard.
> Sorry again about the breakage.
>
> gcc/ChangeLog:
> PR bootstrap/82610
> * system.h [__cplusplus]: Include <memory>.
> ---
> gcc/system.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/gcc/system.h b/gcc/system.h
> index f0664e9..d6e1637 100644
> --- a/gcc/system.h
> +++ b/gcc/system.h
> @@ -233,6 +233,7 @@ extern int errno;
> # include <vector>
> #endif
> # include <cstring>
> +# include <memory>
> # include <new>
> # include <utility>
> #endif
> --
> 1.8.5.3
>