From: Jason Merrill Date: Thu, 17 May 2018 23:28:34 +0000 (-0400) Subject: line-map.c (linemap_init): Use placement new. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b2ff74575d7269d6f3a9a83b86e68d229cbc539f;p=gcc.git line-map.c (linemap_init): Use placement new. * line-map.c (linemap_init): Use placement new. * system.h: #include . From-SVN: r260343 --- diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index a66948ff1ac..88cbe1b14c7 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,3 +1,8 @@ +2018-05-17 Jason Merrill + + * line-map.c (linemap_init): Use placement new. + * system.h: #include . + 2018-03-14 David Malcolm * include/line-map.h (compare): New function on linenum_type. diff --git a/libcpp/line-map.c b/libcpp/line-map.c index a84084c99f0..b2ebfeb16d4 100644 --- a/libcpp/line-map.c +++ b/libcpp/line-map.c @@ -348,7 +348,7 @@ linemap_init (struct line_maps *set, /* PR33916, needed to fix PR82939. */ memset (set, 0, sizeof (struct line_maps)); #else - *set = line_maps (); + new (set) line_maps(); #endif set->highest_location = RESERVED_LOCATION_COUNT - 1; set->highest_line = RESERVED_LOCATION_COUNT - 1; diff --git a/libcpp/system.h b/libcpp/system.h index 719435df949..76420e16cfb 100644 --- a/libcpp/system.h +++ b/libcpp/system.h @@ -438,6 +438,10 @@ 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 +#endif + /* Poison identifiers we do not want to use. */ #if (GCC_VERSION >= 3000) #undef calloc