Re: [Boost-bugs] [Boost C++ Libraries] #7270: C++11 narrowing problem in gil

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #7270: C++11 narrowing problem in gil
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-12-09 01:59:01


#7270: C++11 narrowing problem in gil
-------------------------------+----------------------
  Reporter: jbosch | Owner: hljin
      Type: Bugs | Status: reopened
 Milestone: To Be Determined | Component: GIL
   Version: Boost 1.63.0 | Severity: Problem
Resolution: | Keywords: c++11
-------------------------------+----------------------
Changes (by babatakao@…):

 * status: closed => reopened
 * version: Boost 1.51.0 => Boost 1.63.0
 * resolution: fixed =>

Comment:

 boost 1.61 still causes the error with clang: Apple LLVM version 7.3.0
 (clang-703.0.31)

 {{{
 /buildroot/libs/boost/include/boost/gil/channel_algorithm.hpp:55:85:
 error: non-type template argument evaluates to -1, which cannot be
 narrowed to type 'unsigned long' [-Wc++11-narrowing]
 struct unsigned_integral_max_value : public
 mpl::integral_c<UnsignedIntegralChannel,-1> {};
 ^
 /buildroot/libs/boost/include/boost/gil/channel_algorithm.hpp:55:85:
 /libs/boost/include/boost/gil/channel_algorithm.hpp:205:19: note: in
 instantiation of template class
 'boost::gil::detail::unsigned_integral_max_value<unsigned long>' requested
 here
         if (src > unsigned_integral_max_value<uintmax_t>::value - div2)
                   ^
 1 error generated.
 }}}

 and it does not seem to be fixed on boost 1.63.0 beta1.

 (The error occurs only if "-std=c++11" is given.)

 "boost-gil-clang-c++11-narrowing.patch" fixes the error.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/7270#comment:3>
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:20 UTC