Intel® C++ Compiler
Support and discussions for creating C++ code that runs on platforms based on Intel® processors.
7691 Discussions

C++ 13.0 doesn't instantiate the template function

Dmitrichenko__Max
166 Views

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

[cpp]

#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()
{
}

[/cpp]

0 Kudos
5 Replies
Dmitrichenko__Max
166 Views
Is any feedback going to be here from Intel about this bug?
JenniferJ
Moderator
166 Views
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
Dmitrichenko__Max
166 Views
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 ....
JenniferJ
Moderator
166 Views
Well, the issue is reported now. When working on multiple issues, sometimes the OS does get mixed up. Jennifer
JenniferJ
Moderator
166 Views

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

Reply