On Mon, May 21, 2018 at 9:25 PM, Gerald Pfeifer <ger...@pfeifer.com> wrote:
> Hi Jason,
>
> I'm afraid this change
>
>   2018-05-17  Jason Merrill  <ja...@redhat.com>
>
>         * line-map.c (linemap_init): Use placement new.
>         * system.h: #include <new>.
>
> broke bootstrap on systems using libc++ instead of libstdc++ (such
> as newer versions of FreeBSD, reported on FreeBSD 11 but could also
> be noticable on Darwin):
>
>   gmake[3]: Entering directory 
> '/scratch/tmp/gerald/OBJ-0522-0110/build-x86_64-unknown-freebsd11.2/libcpp'
>   c++ -std=gnu++98  -I/scratch/tmp/gerald/gcc-HEAD/libcpp -I.
>   -I/scratch/tmp/gerald/gcc-HEAD/libcpp/../include
>   -I/scratch/tmp/gerald/gcc-HEAD/libcpp/include
>   -g -O2 -W -Wall -Wno-narrowing -Wwrite-strings -Wmissing-format-attribute
>   -pedantic -Wno-long-long  -fno-exceptions -fno-rtti
>   -I/scratch/tmp/gerald/gcc-HEAD/libcpp -I.
>   -I/scratch/tmp/gerald/gcc-HEAD/libcpp/../include
>   -I/scratch/tmp/gerald/gcc-HEAD/libcpp/include   -c -o charset.o
>   -MT charset.o -MMD -MP -MF .deps/charset.Tpo
>   /scratch/tmp/gerald/gcc-HEAD/libcpp/charset.c
>   In file included from 
> /scratch/tmp/gerald/gcc-HEAD/libcpp/charset.c:21:/scratch/tmp/gerald/gcc-HEAD/libcpp/system.h:435:9:
>  warning: keyword is hidden by macro definition [-Wkeyword-macro]
>   #define true 1
>           ^
>   /scratch/tmp/gerald/gcc-HEAD/libcpp/system.h:436:9: warning: keyword is 
> hidden by macro definition [-Wkeyword-macro]
>   #define false 0
>           ^
>   In file included from /scratch/tmp/gerald/gcc-HEAD/libcpp/charset.c:21:
>   In file included from /scratch/tmp/gerald/gcc-HEAD/libcpp/system.h:442:
>   In file included from /usr/include/c++/v1/new:91:
>   /usr/include/c++/v1/exception:180:5: error: no member named 'fancy_abort' 
> in namespace 'std::__1'; did you mean simply 'fancy_abort'?
>       _VSTD::abort();
>       ^~~~~~~
>   /usr/include/c++/v1/__config:447:15: note: expanded from macro '_VSTD'
>   #define _VSTD std::_LIBCPP_NAMESPACE
>                 ^
>   /scratch/tmp/gerald/gcc-HEAD/libcpp/system.h:399:13: note: 'fancy_abort' 
> declared here
>       extern void fancy_abort (const char *, int, const char *) 
> ATTRIBUTE_NORETURN;
>                   ^
>
>
> The problem appears to be the added #include <new>; we had a similar
> situation last October, cf. the thread starting at
>
>   https://gcc.gnu.org/ml/gcc-patches/2017-10/threads.html#01478
>
> Simply adding #include <memory> before #include <new> does not help
> in this case, though; I just tried that.

Does moving the #include <new> up higher help?
commit 76804c272544cdc90bd2b468f52f414e18f1c6da
Author: Jason Merrill <ja...@redhat.com>
Date:   Mon May 21 22:02:11 2018 -0400

            * system.h: #include <new> earlier.

diff --git a/libcpp/system.h b/libcpp/system.h
index 76420e16cfb..3fde817cb83 100644
--- a/libcpp/system.h
+++ b/libcpp/system.h
@@ -37,6 +37,10 @@ along with GCC; see the file COPYING3.  If not see
 
 #include <stdio.h>
 
+#ifdef __cplusplus
+#include <new>
+#endif
+
 /* Define a generic NULL if one hasn't already been defined.  */
 #ifndef NULL
 #define NULL 0
@@ -438,10 +442,6 @@ extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN;
 /* Some compilers do not allow the use of unsigned char in bitfields.  */
 #define BOOL_BITFIELD unsigned int
 
-#ifdef __cplusplus
-#include <new>
-#endif
-
 /* Poison identifiers we do not want to use.  */
 #if (GCC_VERSION >= 3000)
 #undef calloc

Reply via email to