C++ 13.0 doesn't instantiate the template function

C++ 13.0 doesn't instantiate the template function

The program below fails to link when buillding it with ICPC version 13.0 under Linux (Intel 64). Using boost version 1.51 (without any patches).

The diagnostics:

/mnt/work/Bender2/Bender2/Sources/TestMod/TestSO.cpp:14: undefined reference to `boost::asio::ip::operator!=(boost::asio::ip::basic_resolver_iterator<boost::asio::ip::tcp> const&, boost::asio::ip::basic_resolver_iterator<boost::asio::ip::tcp> const&)'
/mnt/work/Bender2/Bender2/Sources/TestMod/TestSO.cpp:15: undefined reference to `boost::asio::ip::operator!=(boost::asio::ip::basic_resolver_iterator<boost::asio::ip::tcp> const&, boost::asio::ip::basic_resolver_iterator<boost::asio::ip::tcp> const&)'

This operator is not instantiated. The interesting thing: making connect() method a separate function or removing default value from prototype makes program to link successfuly

#include <boost/asio/ip/tcp.hpp>
class test
{
 void connect(boost::asio::ip::tcp::resolver::iterator et = boost::asio::ip::tcp::resolver::iterator());
};
using namespace boost::asio::ip;
void test::connect(tcp::resolver::iterator et)
{
 tcp::resolver::iterator end;
if(et != end) {
 for(; et != end; ++et) {
 break;
 }
 }
}
int main()
{
}

AttachmentSize
Downloadtext/x-c++src testso.cpp382 bytes
6 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Is any feedback going to be here from Intel about this bug?

what the options used?

I tested with your code, it did not complain: icl /c /O2 /D_WIN32_WINDOWS /EHsc /I..\boost_1_51_0 boost_err.cpp

Jennifer

As I said above "ICPC version 13.0 under Linux (Intel 64)". Why are you trying it under WIN32?

Options are following:
icpc -std=c++0x -Wall -g -O2 -msse2 -fPIC ....

Well, the issue is reported now.

When working on multiple issues, sometimes the OS does get mixed up.

Jennifer

This issue has been fixed in the 13.0 update2 and later. You can download the latest Intel C++ Composer XE 2013 for Linux from the Intel Registration Center or the eval site.

Jennifer

Leave a Comment

Please sign in to add a comment. Not a member? Join today