Boost C++ Libraries: Ticket #11064: boost support c++11 with Solaris Studio 12.4 https://svn.boost.org/trac10/ticket/11064 <p> My Environment: </p> <ol><li>boost_version: 1_57 </li><li>solaris stuation version: SolarisStudio12.4-solaris-sparc-bin.tar.bz2 (download yesterday) </li><li>OS version: bash-3.2$ cat /etc/release </li></ol><blockquote> <p> Oracle Solaris 10 8/11 s10s_u10wos_17b SPARC </p> </blockquote> <blockquote> <p> Copyright (c) 1983, 2011, Oracle and/or its affiliates. All rights reserved. </p> <blockquote> <p> Assembled 23 August 2011 </p> </blockquote> </blockquote> <p> </p> <pre class="wiki">bash-3.2$ cd tools/build/src/engine/ bash-3.2$ ./build.sh sun bash-3.2$ tools/build/src/engine/bin.solarissparc/bjam toolset=sun --prefix=/export/home/oracle/zhifan/boost address-model=64 --disable-icu --with-regex --with-log --with-program_options -j64 install </pre><p> With some code fix in boost, I can run the above command without any "failed". Here is my simple test code: </p> <pre class="wiki">bash-3.2$ cat boost_log.cc #include &lt;boost/log/core.hpp&gt; #include &lt;boost/log/trivial.hpp&gt; #include &lt;boost/log/expressions.hpp&gt; #include &lt;vector&gt; int main() { std::vector&lt;int&gt; a{1, 2, 3,4,5}; for (auto i : a) { BOOST_LOG_TRIVIAL(fatal) &lt;&lt; "RedoFile::init "; } return 0; } </pre><p> </p> <pre class="wiki">bash-3.2$ CC -mt -std=c++11 -m64 -I/export/home/oracle/zhifan/boost/include -DBOOST_LOG_DYN_LINK -L/export/home/oracle/zhifan/boost/lib -lboost_log -DBOOST_LOG_DYN_LINK boost_log.cc -o boost_log "/export/home/oracle/zhifan/boost/include/boost/log/utility/formatting_ostream.hpp", line 551: Error: Cannot use boost::log::v2_mt_posix::basic_formatting_ostream&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt;&gt;::sentry to initialize bool. "boost_log.cc", line 10: Where: While instantiating "boost::log::v2_mt_posix::basic_formatting_ostream&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt;&gt;::operator&lt;&lt;(const char*)". "boost_log.cc", line 10: Where: Instantiated from non-template code. "/export/home/oracle/zhifan/boost/include/boost/log/utility/formatting_ostream.hpp", line 551: Error: An expression of scalar type was expected. "boost_log.cc", line 10: Where: While instantiating "boost::log::v2_mt_posix::basic_formatting_ostream&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt;&gt;::operator&lt;&lt;(const char*)". "boost_log.cc", line 10: Where: Instantiated from non-template code. 2 Error(s) detected. </pre><p> But if I compile this code with boost library compiled by gcc, it works perfectly. </p> <pre class="wiki">bash-3.2$ g++ -pthread -std=c++11 -m64 -I/export/home/oracle/zhifan/boost_gcc/include -DBOOST_LOG_DYN_LINK -L/export/home/oracle/zhifan/boost_gcc/lib -lboost_log -DBOOST_LOG_DYN_LINK boost_log.cc -o boost_log bash-3.2$ export LD_LIBRARY_PATH=/export/home/oracle/zhifan/boost_gcc/lib:$LD_LIBRARY_PATH bash-3.2$ ./boost_log [2015-02-27 23:26:21.436813] [0x10000000] [fatal] RedoFile::init [2015-02-27 23:26:21.438511] [0x10000000] [fatal] RedoFile::init [2015-02-27 23:26:21.438591] [0x10000000] [fatal] RedoFile::init [2015-02-27 23:26:21.438662] [0x10000000] [fatal] RedoFile::init [2015-02-27 23:26:21.438735] [0x10000000] [fatal] RedoFile::init </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11064 Trac 1.4.3 viboes Thu, 26 Mar 2015 07:30:07 GMT description changed https://svn.boost.org/trac10/ticket/11064#comment:1 https://svn.boost.org/trac10/ticket/11064#comment:1 <ul> <li><strong>description</strong> modified (<a href="/trac10/ticket/11064?action=diff&amp;version=1">diff</a>) </li> </ul> Ticket viboes Thu, 26 Mar 2015 07:30:31 GMT component changed; owner set https://svn.boost.org/trac10/ticket/11064#comment:2 https://svn.boost.org/trac10/ticket/11064#comment:2 <ul> <li><strong>owner</strong> set to <span class="trac-author">Andrey Semashev</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">log</span> </li> </ul> Ticket Andrey Semashev Thu, 26 Mar 2015 09:00:47 GMT <link>https://svn.boost.org/trac10/ticket/11064#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11064#comment:3</guid> <description> <p> This is a compiler bug, the sentry class defined by STL must be convertible to bool (which makes basic_formatting_ostream&lt;&gt;::sentry convertible as well). Please, report it to the compiler vendor. </p> <p> As for the workaround, I don't have this compiler to test it. I'd appreciate if you could provide a patch. I can suggest two possible avenues of experimenting: </p> <ol><li>Change all conditional expressions involving sentry to double negative forms. E.g. change "if (guard)" to "if (!!guard)". </li></ol><ol start="2"><li>Add operator!() and BOOST_EXPLICIT_OPERATOR_BOOL() to basic_formatting_ostream&lt;&gt;::sentry definition. </li></ol> </description> <category>Ticket</category> </item> <item> <dc:creator>Andrey Semashev</dc:creator> <pubDate>Sun, 05 Jul 2015 19:08:52 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11064#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11064#comment:4</guid> <description> <p> Ping? Have you tried the suggested changes? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Andrey Semashev</dc:creator> <pubDate>Tue, 21 Jul 2015 16:03:35 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/11064#comment:5 https://svn.boost.org/trac10/ticket/11064#comment:5 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">wontfix</span> </li> </ul> <p> No answer from the reporter, further course of action unclear. </p> Ticket