Piotr Kowalski <koval.gnu <at> gmail.com> writes:
What options are you using to compile your sample code?I tried CC -
I<boost-path> -library=stlport4 -mt -c fail.cpp and it works fine for Sun Studio 11 (CC 5.8), Sun Studio 12 (CC 5.9), Solaris Studio 12.2 (CC 5.11) and 12.3 (CC 5.12). All of them compile this without errors, both with and without -mt option (single/multi-threaded version). First thing, thank you for your time and help! I'm compiling with CC -I<boost-path> -features=extensions -library=stlport4 -mt - DBOOST_THREAD_DONT_USE_ATOMIC -O2 -DNDEBUG -c fail.cpp My exact version is $ CC -V CC: Sun C++ 5.10 SunOS_i386 Patch 128229-32 2013/12/04
Unfortunately I have no Sun Studio 12.1 so this may be a bug specific to this version or even patch set. Tried with Boost 1.59.0 and 1.60.0.
It does seem like a problem with this specific version :(
If you are using the same options, is there a possibility you have
patched Boost or your system/stlport headers in any way? Maybe your boost/config/user.hpp contains some customizations which might affect the code?
I have not patched boost or changed anything in the system. Also, no changes to boost/config/user.hpp
If feel the error does not come from any manipulations on compiler/Boost headers, would you mind attaching the output file created by CC when you replace -c with -P?
I get a 432K file. What's the best way to share it here? Thanks again for your help with this.
2015-12-29 10:14 GMT+01:00 <dariomt <at> gmail.com>: Hi all, I have found a problem compiling Boost,
in libs/serialization/src/basic_text_oprimitive.cpp the usage of boost::iterator::iterator_facade is problematic.
I have reduced it to a two line minimal case:
#include <boost/archive/iterators/ostream_iterator.hpp> boost::archive::iterators::ostream_iterator<char> it;
Trying to compile this with SunCC 5.10 (Sun Studio 12.1) in Solaris I
get the following error:
"boost/iterator/iterator_facade.hpp", line 779: Error: value is not a
"boost/archive/iterators/ostream_iterator.hpp", line 40: Where: While specializing "boost::iterators::iterator_facade<boost::archive::iterators::ostream_ite rator<char>, char, std::output_iterator_tag, boost::archive::iterators::ostream_iterator<char>&, int>". "boost/archive/iterators/ostream_iterator.hpp", line 40: Where: Specialized in boost::archive::iterators::ostream_iterator<char>. "fail.cpp", line 2: Where: Specialized in non-template code.
I guess it must be some bug in the compiler, because if I try to instantiate directly the template mentioned in the error message it works fine. (i.e. value is indeed a member).
#include <boost/iterator/iterator_facade.hpp> const bool value = boost::iterators::detail::is_traversal_at_least< std::output_iterator_tag, boost::iterators::bidirectional_traversal_tag >::value;
For reference, this problem was *not* present in Boost 1.55.0.
Thanks!
PS: I have mentioned both libraries in the subject because I don't know if this is a problem with Boost.Iterator code, or with the usage of that
member of boost::iterators::detail::is_traversal_at_least<std::output_iterator_tag, boost::iterators::bidirectional_traversal_tag>. library from Boost.Serialization.