Boost C++ Libraries: Ticket #11815: boost::config defines BOOST_NO_CXX11_RVALUE_REFERENCES under icc 15
https://svn.boost.org/trac10/ticket/11815
<p>
When compiling with icc version 15.0.4 under the C++11 standard, the macro BOOST_NO_CXX11_RVALUE_REFERENCES is defined, even though icc supports rvalue references.
</p>
<p>
I discovered this when attempting to use the intrusive_ptr class template's move constructor, so I created a demonstration that uses intrusive_ptr.
</p>
<pre class="wiki">$ icc --version
icc (ICC) 15.0.4 20150805
icc -I/path/to/boost/1.56.0/include/ -std=c++11 ./intrusive_ptr_test.cpp -o intrusive_ptr_test_icc
$ ./intrusive_ptr_test_icc
__cplusplus: 201103
BOOST_VERSION: 105600
std::is_nothrow_move_constructible<S_ptr>: false
BOOST_NO_CXX11_RVALUE_REFERENCES: <undefined>
__INTEL_COMPILER: 1500
BOOST_INTEL_CXX_VERSION: 1500
</pre><p>
I expected that BOOST_NO_CXX11_RVALUE_REFERENCES would not be defined, because this version of icc <a class="ext-link" href="https://software.intel.com/en-us/articles/c0x-features-supported-by-intel-c-compiler"><span class="icon"></span>supports rvalue references</a>.
</p>
<p>
When built using g++ 5.2.0, the macro is not defined, so the intrusive_ptr class template is nothrow-move-constructible.
</p>
<pre class="wiki">$ g++ --version
g++ (TPM built 20150717) 5.2.0
Copyright (C) 2015 Free Software Foundation, Inc.
$ g++ -I/path/to/boost/1.56.0/include/ -std=c++11 ./intrusive_ptr_test.cpp -o intrusive_ptr_test_gcc
$ ./intrusive_ptr_test_gcc
__cplusplus: 201103
BOOST_VERSION: 105600
std::is_nothrow_move_constructible<S_ptr>: true
BOOST_NO_CXX11_RVALUE_REFERENCES: <undefined>
</pre><p>
I believe this is the same problem reported in <a class="ext-link" href="https://svn.boost.org/trac/boost/ticket/9829"><span class="icon"></span>ticket #9829</a>.
</p>
<p>
This problem does not occur in boost 1.58.0.
</p>
en-usBoost C++ Libraries/htdocs/site/boost.png
https://svn.boost.org/trac10/ticket/11815
Trac 1.4.3nmusolino@…Sun, 22 Nov 2015 00:10:46 GMTattachment set
https://svn.boost.org/trac10/ticket/11815
https://svn.boost.org/trac10/ticket/11815
<ul>
<li><strong>attachment</strong>
→ <span class="trac-field-new">intrusive_ptr_test.cpp</span>
</li>
</ul>
<p>
Demonstration of boost::config problem
</p>
TicketJohn MaddockSun, 22 Nov 2015 10:00:15 GMT
<link>https://svn.boost.org/trac10/ticket/11815#comment:1 </link>
<guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11815#comment:1</guid>
<description>
<p>
I don't see this (in develop anyway), some comments:
</p>
<ul><li>At Intel's request we changed our configuration to match whatever version of GCC Intel is emulating, so the underlying gcc version is critical.
</li><li>Your test output above shows BOOST_NO_CXX11_RVALUE_REFERENCES as *not* being set for Intel and GCC alike.
</li><li>The best way to see what is and isn't being set is to cd into libs/config/test and build and run the program config_info.cpp. I don't see BOOST_NO_CXX11_RVALUE_REFERENCES set in either C++11 or C++ 14 mode.
</li></ul><p>
Best, John.
</p>
</description>
<category>Ticket</category>
</item>
<item>
<dc:creator>anonymous</dc:creator>
<pubDate>Sun, 22 Nov 2015 13:40:07 GMT</pubDate>
<title/>
<link>https://svn.boost.org/trac10/ticket/11815#comment:2 </link>
<guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11815#comment:2</guid>
<description>
<p>
I'm sorry, I made a mistake when examining different versions of boost. BOOST_NO_CXX11_RVALUE_REFERENCES is defined under boost 1.54:
</p>
<pre class="wiki">$ icc -I/path/to/boost/1.54.0/include/ -std=c++11 ./intrusive_ptr_test.cpp -o intrusive_ptr_test_icc
$ $ ./intrusive_ptr_test_icc
__cplusplus: 201103
BOOST_VERSION: 105400
std::is_nothrow_move_constructible<S_ptr>: false
BOOST_NO_CXX11_RVALUE_REFERENCES: <defined>
__INTEL_COMPILER: 1500
BOOST_INTEL_CXX_VERSION: 1500
</pre><pre class="wiki">$ g++ -I/path/to/boost/1.54.0/include/ -std=c++11 ./intrusive_ptr_test.cpp -o intrusive_ptr_test_gcc
$ ./intrusive_ptr_test_gcc
__cplusplus: 201103
BOOST_VERSION: 105400
std::is_nothrow_move_constructible<S_ptr>: true
BOOST_NO_CXX11_RVALUE_REFERENCES: <undefined>
</pre><p>
I can build the config_info program if it would be helpful.
</p>
</description>
<category>Ticket</category>
</item>
<item>
<dc:creator>anonymous</dc:creator>
<pubDate>Sun, 22 Nov 2015 13:40:51 GMT</pubDate>
<title>version changed
https://svn.boost.org/trac10/ticket/11815#comment:3
https://svn.boost.org/trac10/ticket/11815#comment:3
<ul>
<li><strong>version</strong>
<span class="trac-field-old">Boost 1.56.0</span> → <span class="trac-field-new">Boost 1.54.0</span>
</li>
</ul>
Ticketnmusolino@…Sun, 22 Nov 2015 14:28:32 GMT
<link>https://svn.boost.org/trac10/ticket/11815#comment:4 </link>
<guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11815#comment:4</guid>
<description>
<p>
Using config_info, I do see some BOOST_NO_CXX11_* macros, in particular BOOST_NO_CXX11_NOEXCEPT and BOOST_NO_CXX11_CONSTEXPR, that appear to be defined incorrectly under boost 1.56.0 and icc. The _NOEXCEPT issue causes the intrusive_ptr class to not be nothrow-movable.
</p>
<p>
Would you prefer that I create a new ticket, or place more information here? My inclination is to create a new ticket, to refer to a different boost version [1.56.0].
</p>
</description>
<category>Ticket</category>
</item>
<item>
<author>nmusolino@…</author>
<pubDate>Sun, 22 Nov 2015 14:28:35 GMT</pubDate>
<title/>
<link>https://svn.boost.org/trac10/ticket/11815#comment:4 </link>
<guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11815#comment:4</guid>
<description>
<p>
Using config_info, I do see some BOOST_NO_CXX11_* macros, in particular BOOST_NO_CXX11_NOEXCEPT and BOOST_NO_CXX11_CONSTEXPR, that appear to be defined incorrectly under boost 1.56.0 and icc. The _NOEXCEPT issue causes the intrusive_ptr class to not be nothrow-movable.
</p>
<p>
Would you prefer that I create a new ticket, or place more information here? My inclination is to create a new ticket, to refer to a different boost version [1.56.0].
</p>
</description>
<category>Ticket</category>
</item>
<item>
<dc:creator>John Maddock</dc:creator>
<pubDate>Sun, 22 Nov 2015 17:46:08 GMT</pubDate>
<title/>
<link>https://svn.boost.org/trac10/ticket/11815#comment:5 </link>
<guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11815#comment:5</guid>
<description>
<p>
Post the info here, but I still don't see it, note that for Intel-15 and later the configuration defaults to just
</p>
<p>
#include <boost/config/compiler/gcc.hpp>
</p>
<p>
Plus some logic to correctly set BOOST_COMPILER.
</p>
<p>
So you should see exactly the same configuration as the GCC version being emulated.
</p>
<p>
What does your config_info.cpp output look like (note - all of it please! ;) )
</p>
</description>
<category>Ticket</category>
</item>
<item>
<dc:creator>anonymous</dc:creator>
<pubDate>Sun, 22 Nov 2015 19:20:29 GMT</pubDate>
<title/>
<link>https://svn.boost.org/trac10/ticket/11815#comment:6 </link>
<guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11815#comment:6</guid>
<description>
<p>
Thanks, by the way, for your responsiveness on this. I appreciate your efforts.
</p>
<pre class="wiki">$ tar -xzf boost_1_56_0.tar.gz
$ icc --version
icc (ICC) 15.0.4 20150805
Copyright (C) 1985-2015 Intel Corporation. All rights reserved.
$ icc -I./boost_1_56_0/ -std=c++11 ./boost_1_56_0/libs/config/test/config_info.cpp -o ./config_info_1_56_0_icc
$ ./config_info_1_56_0_icc > config_info_output_icc15.txt
</pre><p>
I noticed that icc was emulating g++ 5.1 (see \_\_VERSION\_\_ in config_info_output_icc51.txt), so I built config_info using g++ 5.1 for comparison.
</p>
<pre class="wiki">$ g++ --version
g++ (TPM built 20150527) 5.1.0
Copyright (C) 2015 Free Software Foundation, Inc.
$ g++ -I./boost_1_56_0 -std=c++11 ./boost_1_56_0/libs/config/test/config_info.cpp -o config_info_1_56_0_gcc51
$ ./config_info_1_56_0_gcc51 > config_info_output_gcc51.txt
</pre><p>
The following boost config definitions seem incorrect to me, because icc 15 supports "constexpr" and "noexcept". I realize that the definition of BOOST_NOEXCEPT is probably a consequence of BOOST_NO_CXX11_NOEXCEPT being defined. Excerpt from attached file config_info_output_icc15.txt:
</p>
<pre class="wiki"> BOOST_COMPILER_CONFIG ="boost/config/compiler/intel.hpp"
[...]
BOOST_NO_CXX11_CONSTEXPR [no value]
[...]
BOOST_NO_CXX11_NOEXCEPT [no value]
[...]
BOOST_CONSTEXPR [no value]
BOOST_CONSTEXPR_OR_CONST =const
BOOST_STATIC_CONSTEXPR =static const
BOOST_NOEXCEPT [no value]
[...]
</pre><p>
In contrast, these defintions appear correct under g++ 5.1. Excerpt from attached file config_info_output_gcc51.txt:
</p>
<pre class="wiki"> BOOST_COMPILER_CONFIG ="boost/config/compiler/gcc.hpp"
[...]
BOOST_CONSTEXPR =constexpr
BOOST_CONSTEXPR_OR_CONST =constexpr
BOOST_STATIC_CONSTEXPR =static constexpr
BOOST_NOEXCEPT =noexcept
</pre>
</description>
<category>Ticket</category>
</item>
<item>
<author>nmusolino@…</author>
<pubDate>Sun, 22 Nov 2015 19:20:52 GMT</pubDate>
<title>attachment set
https://svn.boost.org/trac10/ticket/11815
https://svn.boost.org/trac10/ticket/11815
<ul>
<li><strong>attachment</strong>
→ <span class="trac-field-new">config_info_output_icc15.txt</span>
</li>
</ul>
Ticketnmusolino@…Sun, 22 Nov 2015 19:21:06 GMTattachment set
https://svn.boost.org/trac10/ticket/11815
https://svn.boost.org/trac10/ticket/11815
<ul>
<li><strong>attachment</strong>
→ <span class="trac-field-new">config_info_output_gcc51.txt</span>
</li>
</ul>
Ticketnmusolino@…Sun, 22 Nov 2015 19:28:43 GMT
<link>https://svn.boost.org/trac10/ticket/11815#comment:7 </link>
<guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11815#comment:7</guid>
<description>
<p>
Just to clarify, all the information in comment 6 pertains to boost 1.56.0. This is probably clear from the shell commands and the output, but I just want to highlight that here.
</p>
</description>
<category>Ticket</category>
</item>
<item>
<dc:creator>John Maddock</dc:creator>
<pubDate>Mon, 23 Nov 2015 08:48:14 GMT</pubDate>
<title>status changed; resolution set
https://svn.boost.org/trac10/ticket/11815#comment:8
https://svn.boost.org/trac10/ticket/11815#comment:8
<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">worksforme</span>
</li>
</ul>
<p>
OK I missed the boost-1.56 part - we didn't get around to configuring for Intel-15 until this autumn - if you can upgrade to 1.59 this should be fixed.
</p>
Ticket