Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#7231 closed Bugs (fixed)

Boost ICL "party" example fails compilation using Clang 3.1

Reported by: Jess Morecroft <jess.morecroft@…> Owned by: Joachim Faulhaber
Milestone: To Be Determined Component: ICL
Version: Boost 1.49.0 Severity: Problem
Keywords: clang icl Cc:

Description

Test program copied exactly from "party" example in boost icl documentation (attached). Compile fails on Mac OS X 10.8 (ML) using latest Clang - version below. (compiles OK using gcc)

Looks like Clang is not picking up the operator+= template in the concept header? Probably a Clang bug and if so sorry for the ticket! ...

jessmorecroft:~$ c++ --version
Apple clang version 4.0 (tags/Apple/clang-421.0.57) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin12.0.0
Thread model: posix
jessmorecroft:~$ c++ test.cpp 
In file included from test.cpp:5:
In file included from /usr/local/include/boost/icl/interval_map.hpp:13:
In file included from /usr/local/include/boost/icl/interval_set.hpp:14:
In file included from /usr/local/include/boost/icl/interval_base_set.hpp:24:
In file included from /usr/local/include/boost/icl/associative_interval_container.hpp:16:
In file included from /usr/local/include/boost/icl/concept/interval_set.hpp:13:
In file included from /usr/local/include/boost/icl/detail/set_algo.hpp:16:
/usr/local/include/boost/icl/functors.hpp:71:18: error: no viable overloaded '+='
        { object += operand; }
          ~~~~~~ ^  ~~~~~~~
/usr/local/include/boost/icl/interval_base_map.hpp:855:5: note: in instantiation of member function
      'boost::icl::inplace_plus<std::set<std::basic_string<char>, std::less<std::basic_string<char>>,
      std::allocator<std::basic_string<char>>> >::operator()' requested here
    Combiner()((*it_).second, co_val);
    ^
/usr/local/include/boost/icl/interval_base_map.hpp:870:9: note: in instantiation of function template specialization
      'boost::icl::interval_base_map<boost::icl::interval_map<boost::posix_time::ptime,
      std::set<std::basic_string<char>, std::less<std::basic_string<char>>, std::allocator<std::basic_string<char>>>,
      boost::icl::partial_absorber, std::less, icl::inplace_plus, icl::inter_section,
      boost::icl::discrete_interval<boost::posix_time::ptime, less>, std::allocator>, boost::posix_time::ptime,
      std::set<std::basic_string<char>, std::less<std::basic_string<char>>, std::allocator<std::basic_string<char>>>,
      boost::icl::partial_absorber, less, inplace_plus, inter_section,
      boost::icl::discrete_interval<boost::posix_time::ptime, less>,
      allocator>::add_segment<boost::icl::inplace_plus<std::set<std::basic_string<char>,
      std::less<std::basic_string<char>>, std::allocator<std::basic_string<char>>>> >' requested here
        add_segment<Combiner>(inter_val, co_val, it_);
        ^
/usr/local/include/boost/icl/interval_base_map.hpp:966:9: note: in instantiation of function template specialization
      'boost::icl::interval_base_map<boost::icl::interval_map<boost::posix_time::ptime,
      std::set<std::basic_string<char>, std::less<std::basic_string<char>>, std::allocator<std::basic_string<char>>>,
      boost::icl::partial_absorber, std::less, icl::inplace_plus, icl::inter_section,
      boost::icl::discrete_interval<boost::posix_time::ptime, less>, std::allocator>, boost::posix_time::ptime,
      std::set<std::basic_string<char>, std::less<std::basic_string<char>>, std::allocator<std::basic_string<char>>>,
      boost::icl::partial_absorber, less, inplace_plus, inter_section,
      boost::icl::discrete_interval<boost::posix_time::ptime, less>,
      allocator>::add_main<boost::icl::inplace_plus<std::set<std::basic_string<char>,
      std::less<std::basic_string<char>>, std::allocator<std::basic_string<char>>>> >' requested here
        add_main<Combiner>(rest_interval, co_val, it_, last_);
        ^
/usr/local/include/boost/icl/interval_base_map.hpp:314:24: note: in instantiation of function template specialization
      'boost::icl::interval_base_map<boost::icl::interval_map<boost::posix_time::ptime,
      std::set<std::basic_string<char>, std::less<std::basic_string<char>>, std::allocator<std::basic_string<char>>>,
      boost::icl::partial_absorber, std::less, icl::inplace_plus, icl::inter_section,
      boost::icl::discrete_interval<boost::posix_time::ptime, less>, std::allocator>, boost::posix_time::ptime,
      std::set<std::basic_string<char>, std::less<std::basic_string<char>>, std::allocator<std::basic_string<char>>>,
      boost::icl::partial_absorber, less, inplace_plus, inter_section,
      boost::icl::discrete_interval<boost::posix_time::ptime, less>,
      allocator>::_add<boost::icl::inplace_plus<std::set<std::basic_string<char>, std::less<std::basic_string<char>>,
      std::allocator<std::basic_string<char>>>> >' requested here
        this->template _add<codomain_combine>(interval_value_pair);
                       ^
test.cpp:32:11: note: in instantiation of member function
      'boost::icl::interval_base_map<boost::icl::interval_map<boost::posix_time::ptime,
      std::set<std::basic_string<char>, std::less<std::basic_string<char>>, std::allocator<std::basic_string<char>>>,
      boost::icl::partial_absorber, std::less, icl::inplace_plus, icl::inter_section,
      boost::icl::discrete_interval<boost::posix_time::ptime, less>, std::allocator>, boost::posix_time::ptime,
      std::set<std::basic_string<char>, std::less<std::basic_string<char>>, std::allocator<std::basic_string<char>>>,
      boost::icl::partial_absorber, less, inplace_plus, inter_section,
      boost::icl::discrete_interval<boost::posix_time::ptime, less>, allocator>::add' requested here
    party.add( // add and element
          ^
1 error generated.

Attachments (1)

test.cpp (2.7 KB ) - added by Jess Morecroft <jess.morecroft@…> 10 years ago.

Download all attachments as: .zip

Change History (4)

by Jess Morecroft <jess.morecroft@…>, 10 years ago

Attachment: test.cpp added

comment:1 by Joachim Faulhaber, 10 years ago

Hello Jess,

thank you for sending in this report. Unfortunately there are a number of issues with clang and icl. Those seem to be compiler bugs of clang since all other compilers agree in compiling the code correctly.

You could help the clang developers by boiling down those use cases to minimal examples and file tickets to the llvm/clang bug tracker. I'd be interested in such minimal examples as well and would insert them into my test suite.

Currently I won't be able to perform work on this myself.

Regrads, Joachim

comment:2 by Joachim Faulhaber, 10 years ago

Resolution: fixed
Status: newclosed

comment:3 by xprog66@…, 9 years ago

boost 1.53 fixes this issue.

I could compile with clang 3.2.1 in ubuntu 12.10

Note: See TracTickets for help on using tickets.