id summary reporter owner description type status milestone component version severity resolution keywords cc 3779 Warning using less_equal points to bug Edward Diener Aleksey Gurtovoy "Compiling the following metafunction using VC9 gives a warning which suggests an mpl bug: #include #include #include namespace nmspace { struct ResultTypeIntegerValues { typedef boost::mpl::long_<0L> lzero; typedef boost::mpl::long_::const_min> lmin; typedef boost::mpl::less_equal::type type; }; } with warning: c:\utilities\boost\boost_1_40_0\boost\mpl\aux_\integral_wrapper.hpp(73) : warning C4307: '-' : integral constant overflow 1> c:\utilities\boost\boost_1_40_0\boost\mpl\aux_\preprocessed\plain\less_equal.hpp(60) : see reference to class template instantiation 'boost::mpl::long_' being compiled 1> with 1> [ 1> N=-2147483648 1> ] 1> c:\utilities\boost\boost_1_40_0\boost\mpl\aux_\preprocessed\plain\less_equal.hpp(70) : see reference to class template instantiation 'boost::mpl::less_equal_tag' being compiled 1> with 1> [ 1> T=nmspace::ResultTypeIntegerValues::lmin 1> ] 1> c:\programming\programs\xxx\yyy.h(64) : see reference to class template instantiation 'boost::mpl::less_equal' being compiled 1> with 1> [ 1> N1=nmspace::ResultTypeIntegerValues::lmin, 1> N2=nmspace::ResultTypeIntegerValues::lzero 1> ] The same warning occurs using Boost 1.41. As Steve Watanabe pointed out the problem looks to be: typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (value - 1)) ) prior; which overflows when one is already at the minimal value. It seems mpl has to take into account the minimal value when using prior and probably the maximal value when using next. In any case I see nothing wrong in the code and therefore I do not think an overflow condition should not be taking place." Bugs new Boost 1.42.0 mpl Boost 1.41.0 Problem