Does that help old GCC that don't know -Wplacement-new

...and would thus error out with -Werror=pragmas?

Change-Id: I113c43bed4d6d0c03e4c3c68684c50fd386428d9
This commit is contained in:
Stephan Bergmann
2016-01-19 12:01:08 +01:00
parent 59f190a5ac
commit 2c9d652dc7
2 changed files with 5 additions and 2 deletions

View File

@@ -87,6 +87,7 @@ boost_patches += boost_1_59_0.property_tree.wreturn-type.patch
boost_patches += clang-cl.patch.0
boost_patches += gcc6-warnings.patch.0
boost_patches += gcc-pr69327.patch.0
$(eval $(call gb_UnpackedTarball_UnpackedTarball,boost))

View File

@@ -1,11 +1,12 @@
--- boost/function/function_base.hpp
+++ boost/function/function_base.hpp
@@ -305,7 +305,14 @@
@@ -305,7 +305,15 @@
if (op == clone_functor_tag || op == move_functor_tag) {
const functor_type* in_functor =
static_cast<const functor_type*>(static_cast<void*>(&in_buffer.data));
+#if defined __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wpragmas"
+#pragma GCC diagnostic ignored "-Wplacement-new"
+#endif
new (reinterpret_cast<void*>(&out_buffer.data)) functor_type(*in_functor);
@@ -17,12 +18,13 @@
functor_type* f = static_cast<functor_type*>(static_cast<void*>(&in_buffer.data));
--- boost/function/function_template.hpp
+++ boost/function/function_template.hpp
@@ -569,7 +569,14 @@
@@ -569,7 +569,15 @@
void
assign_functor(FunctionObj f, function_buffer& functor, mpl::true_) const
{
+#if defined __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wpragmas"
+#pragma GCC diagnostic ignored "-Wplacement-new"
+#endif
new (reinterpret_cast<void*>(&functor.data)) FunctionObj(f);