[Boost-bugs] [Boost C++ Libraries] #8896: image_view compile error under clang++ 3.8

Subject: [Boost-bugs] [Boost C++ Libraries] #8896: image_view compile error under clang++ 3.8
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-07-24 18:48:46


#8896: image_view compile error under clang++ 3.8
------------------------------------+------------------------------
 Reporter: Shaun Marko <shaunm@…> | Type: Bugs
   Status: new | Milestone: To Be Determined
Component: None | Version: Boost 1.54.0
 Severity: Problem | Keywords: image_view clang
------------------------------------+------------------------------
 The definition of template <std::size_t D> typename axis<D>::iterator
 image_view::axis_iterator(const point& p) (image_view.hpp, line 139)
 confuses clang++ 3.8. The following program fails to compile.

 '''Example program'''
 {{{

 #include <iostream>
 #include <boost/gil/gil_all.hpp>

 using namespace boost;
 using namespace gil;

 int main(int argc, char **argv)
 {
     gray8_image_t img(2,2);
     gray8_view_t vw(view(img));
     gray8_view_t::point_t p(0,0);
     gray8_view_t::axis<0>::iterator iter = vw.axis_iterator<0>(p);
     std::cout << (*iter)[0] << std::endl;
     return 0;
 }
 }}}

 '''clang++ error:'''
 {{{
 clang++ -Wall -I/usr/local/include/ -c img.cpp
 In file included from img.cpp:2:
 In file included from /usr/local/include/boost/gil/gil_all.hpp:27:
 In file included from /usr/local/include/boost/gil/algorithm.hpp:27:
 /usr/local/include/boost/gil/image_view.hpp:139:104: error: reference to
 non-static member function must be called
     template <std::size_t D> typename axis<D>::iterator
 axis_iterator(const point_t& p) const { return
 _pixels.axis_iterator<D>(p); }
 ^~~~~~~~~~~~~~~~~~~~~
 img.cpp:12:47: note: in instantiation of function template specialization
 'boost::gil::image_view<boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<boost::gil::pixel<unsigned
 char, boost::gil::layout<boost::mpl::vector1<boost::gil::gray_color_t>,
 boost::mpl::range_c<int, 0, 1> > > *> > >::axis_iterator<0>' requested
 here
     gray8_view_t::axis<0>::iterator iter = vw.axis_iterator<0>(p);
                                               ^
 In file included from img.cpp:2:
 In file included from /usr/local/include/boost/gil/gil_all.hpp:27:
 In file included from /usr/local/include/boost/gil/algorithm.hpp:27:
 /usr/local/include/boost/gil/image_view.hpp:139:125: error: invalid
 operands to binary expression ('<bound member function type>' and
 'unsigned long')
     template <std::size_t D> typename axis<D>::iterator
 axis_iterator(const point_t& p) const { return
 _pixels.axis_iterator<D>(p); }
 ~~~~~~~~~~~~~~~~~~~~~^~
 2 errors generated.
 *** [img.o] Error code 1

 }}}

 A patch is attached which works against clang 3.8 and gcc 4.2.1.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8896>
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:13 UTC