C++ 13.0 doesn't instantiate the template function

C++ 13.0 doesn't instantiate the template function

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

AnhangGröße
Herunterladen testso.cpp382 Bytes
6 Beiträge / 0 neu
Letzter Beitrag
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.
Bild des Benutzers Max Dmitrichenko

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

Bild des Benutzers 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

Bild des Benutzers 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 ....

Bild des Benutzers Jennifer J. (Intel)

Well, the issue is reported now.

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

Jennifer

Bild des Benutzers 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

Melden Sie sich an, um einen Kommentar zu hinterlassen.