Commit b2ff7457 by Jason Merrill Committed by Jason Merrill

line-map.c (linemap_init): Use placement new.

	* line-map.c (linemap_init): Use placement new.

	* system.h: #include <new>.

From-SVN: r260343
parent 7bbce9b5
2018-05-17 Jason Merrill <jason@redhat.com>
* line-map.c (linemap_init): Use placement new.
* system.h: #include <new>.
2018-03-14 David Malcolm <dmalcolm@redhat.com> 2018-03-14 David Malcolm <dmalcolm@redhat.com>
* include/line-map.h (compare): New function on linenum_type. * include/line-map.h (compare): New function on linenum_type.
......
...@@ -348,7 +348,7 @@ linemap_init (struct line_maps *set, ...@@ -348,7 +348,7 @@ linemap_init (struct line_maps *set,
/* PR33916, needed to fix PR82939. */ /* PR33916, needed to fix PR82939. */
memset (set, 0, sizeof (struct line_maps)); memset (set, 0, sizeof (struct line_maps));
#else #else
*set = line_maps (); new (set) line_maps();
#endif #endif
set->highest_location = RESERVED_LOCATION_COUNT - 1; set->highest_location = RESERVED_LOCATION_COUNT - 1;
set->highest_line = RESERVED_LOCATION_COUNT - 1; set->highest_line = RESERVED_LOCATION_COUNT - 1;
......
...@@ -438,6 +438,10 @@ extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN; ...@@ -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. */ /* Some compilers do not allow the use of unsigned char in bitfields. */
#define BOOL_BITFIELD unsigned int #define BOOL_BITFIELD unsigned int
#ifdef __cplusplus
#include <new>
#endif
/* Poison identifiers we do not want to use. */ /* Poison identifiers we do not want to use. */
#if (GCC_VERSION >= 3000) #if (GCC_VERSION >= 3000)
#undef calloc #undef calloc
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment