--- boost/function/function_base.hpp +++ boost/function/function_base.hpp @@ -305,7 +305,21 @@ if (op == clone_functor_tag || op == move_functor_tag) { const functor_type* in_functor = static_cast(static_cast(&in_buffer.data)); +#if defined __GNUC__ +#pragma GCC diagnostic push +#if defined __clang__ +#if __has_warning("-Wplacement-new") +#pragma GCC diagnostic ignored "-Wplacement-new" +#endif +#else +#pragma GCC diagnostic ignored "-Wpragmas" +#pragma GCC diagnostic ignored "-Wplacement-new" +#endif +#endif new (reinterpret_cast(&out_buffer.data)) functor_type(*in_functor); +#if defined __GNUC__ +#pragma GCC diagnostic pop +#endif if (op == move_functor_tag) { functor_type* f = static_cast(static_cast(&in_buffer.data)); --- boost/function/function_template.hpp +++ boost/function/function_template.hpp @@ -569,7 +569,21 @@ void assign_functor(FunctionObj f, function_buffer& functor, mpl::true_) const { +#if defined __GNUC__ +#pragma GCC diagnostic push +#if defined __clang__ +#if __has_warning("-Wplacement-new") +#pragma GCC diagnostic ignored "-Wplacement-new" +#endif +#else +#pragma GCC diagnostic ignored "-Wpragmas" +#pragma GCC diagnostic ignored "-Wplacement-new" +#endif +#endif new (reinterpret_cast(&functor.data)) FunctionObj(f); +#if defined __GNUC__ +#pragma GCC diagnostic pop +#endif } template void --- boost/multi_index/detail/index_node_base.hpp +++ boost/multi_index/detail/index_node_base.hpp @@ -51,7 +51,14 @@ value_type& value() { +#if defined __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif return *reinterpret_cast(&this->space); +#if defined __GNUC__ +#pragma GCC diagnostic pop +#endif } const value_type& value()const