id summary reporter owner description type status milestone component version severity resolution keywords cc 11044 boost::rv inherits off union, when such passed as template argument Petr Machata Ion Gaztañaga "Consider the following minimal reproducer: {{{ template struct wrap { typedef T type; }; template class rv: public wrap ::type {}; template struct circular_buffer { typedef const value_type& param_value_type; typedef rv< value_type >& rvalue_type; void push_back(param_value_type item) {} void push_back(rvalue_type item) {} }; union U { int i; char c; }; void f(circular_buffer b, const U& u) { b.push_back(u); } }}} Certain GCC 5.0's had a bug where rv would be instantiated, even though it doesn't have to be (so I am told), which uncovered the latent bug in Boost that rv inherits off union when given one. Proposed patch: {{{ diff -up ./move/core.hpp~ ./move/core.hpp --- boost/move/core.hpp~ 2015-02-09 17:33:35.000000000 +0100 +++ boost/move/core.hpp 2015-02-13 13:54:52.012130813 +0100 @@ -43,6 +43,7 @@ #if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_MOVE_DOXYGEN_INVOKED) #include + #include //Move emulation rv breaks standard aliasing rules so add workarounds for some compilers #if defined(__GNUC__) && (__GNUC__ >= 4) && \ @@ -65,7 +66,7 @@ template class rv : public ::boost::move_detail::if_c - < ::boost::move_detail::is_class_or_union::value + < ::boost::is_class::value , T , ::boost::move_detail::nat >::type }}} I regtested this on x86_64 using GCC 5.0.0, and noted no regressions. However I'm not sure if pulling in type traits like this is admissible--I mean, why else reimplement is_class_or_union in Boost.Move? Historical reasons?" Bugs closed To Be Determined move Boost 1.57.0 Problem fixed