Opened 9 years ago
Closed 4 years ago
#8896 closed Bugs (fixed)
image_view compile error under clang 3.1
Reported by: | Owned by: | Stefan Seefeld | |
---|---|---|---|
Milestone: | Boost 1.69 | Component: | gil USE GITHUB |
Version: | Boost 1.54.0 | Severity: | Problem |
Keywords: | image_view clang | Cc: | smarko@…, mateusz@… |
Description
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.
Attachments (1)
Change History (9)
by , 9 years ago
comment:1 by , 9 years ago
Summary: | image_view compile error under clang++ 3.8 → image_view compile error under clang 3.1 |
---|
Correction: clang 3.1
comment:2 by , 9 years ago
Cc: | added |
---|
comment:3 by , 9 years ago
Component: | None → GIL |
---|---|
Owner: | set to |
comment:4 by , 6 years ago
Cc: | added |
---|
comment:5 by , 5 years ago
Owner: | changed from | to
---|
comment:7 by , 4 years ago
Milestone: | To Be Determined → Boost 1.69 |
---|
comment:8 by , 4 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
image_view.hpp patch