Closed yuvalif closed 2 years ago
@pdimov, thanks! will close in favor of the other one.
Hi, Compiling Boost 1.81 with clang 16.0.0, I still see this sort of error:
clang-vxworks.compile.c++ ../bin.v2/libs/numeric/conversion/test/traits_test.test/clang-vxworks-16.0.0.1/debug/static-only-on/target-os-vxworks/traits_test.o In file included from ../libs/numeric/conversion/test/traits_test.cpp:19: In file included from ../boost/numeric/conversion/conversion_traits.hpp:13: In file included from ../boost/numeric/conversion/detail/conversion_traits.hpp:21: In file included from ../boost/numeric/conversion/detail/issubranged.hpp:17: In file included from ../boost/mpl/multiplies.hpp:17: In file included from ../boost/mpl/times.hpp:19: In file included from ../boost/mpl/aux/arithmetic_op.hpp:17: In file included from ../boost/mpl/integralc.hpp:32: ../boost/mpl/aux/integral_wrapper.hpp:73:31: error: integer value -1 is outside the valid range of values [0, 3] for this enumeration type [-Wenum-constexpr-conversion] typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUETYPE, (value - 1)) ) prior; ^ ../boost/mpl/aux/static_cast.hpp:24:47: note: expanded from macro 'BOOST_MPL_AUX_STATIC_CAST' # define BOOST_MPL_AUX_STATIC_CAST(T, expr) static_cast
(expr) ^
The change https://github.com/boostorg/numeric_conversion/commit/50a1eae942effb0a9b90724323ef8f2a67e7984a is already present. Any ideas why it might not be effective in preventing the compile error in my environment? I am using somewhat uncommon standard C++ libraries (from VxWorks, modified Dinkum libraries), but it looks like most of the issue is inside Boost headers...
Hard to say. I tried it on Compiler Explorer and it worked: https://godbolt.org/z/dhrscKoz1.
using boost 1.79 and clang 16 I get the following compilation errors when trying to define the next/prev types of an enumerated type in the range [0,3]: