Subject: Re: [Boost-bugs] [Boost C++ Libraries] #9647: BOOST_MPL_ASSERT_RELATION fails to properly handle unsigned types
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-03-23 18:23:55
#9647: BOOST_MPL_ASSERT_RELATION fails to properly handle unsigned types
-------------------------------+----------------------
Reporter: ramey | Owner: viboes
Type: Bugs | Status: assigned
Milestone: To Be Determined | Component: integer
Version: Boost 1.54.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------+----------------------
Comment (by ramey):
I looked into this a little bit more.
First of all, my original guess about problematic type promotions was
wrong - I don't think there is any issue with libc++ or anything else in
the standard library.
The following test program illustrates my
{{{
#include <boost/integer_traits.hpp>
#include <boost/mpl/assert.hpp>
BOOST_MPL_ASSERT_RELATION(
(boost::integer_traits<unsigned long>::const_max),
>,
(boost::integer_traits<unsigned char>::const_max)
); // compile error under clang
enum { x = (
(boost::integer_traits<unsigned long>::const_max)
>
(boost::integer_traits<unsigned char>::const_max)
)
}; // compiles OK - can't figure out why
constexpr bool result = (
(boost::integer_traits<unsigned long>::const_max)
>
(boost::integer_traits<unsigned char>::const_max)
); // compiles fine
static_assert(result, "compilation error");
int main(int argc, char * argv[]){
return ! (boost::integer_traits<unsigned long>::const_max >
boost::integer_traits<unsigned char>::const_max);
}
}}}
So I believe this is an issue with MPL_ASSERT_RELATION. I've believe the
problem is found in boost/mpl/assert.hpp at the line #329: It's probably
deeper than this but I didn't trace it further
Robert Ramey
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/9647#comment:4> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:18 UTC