C++ 13.0 doesn't instantiate the template function

C++ 13.0 doesn't instantiate the template function

imagem de Max Dmitrichenko

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

AnexoTamanho
Download testso.cpp382 bytes
6 posts / 0 new
Último post
Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.
imagem de Max Dmitrichenko

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

imagem de Jennifer J. (Intel)

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

imagem de Max Dmitrichenko

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 ....

imagem de Jennifer J. (Intel)

Well, the issue is reported now.

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

Jennifer

imagem de Jennifer J. (Intel)

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

Faça login para deixar um comentário.