Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7944 Discussions

Yet another C++11 error (RTTI deactivated ?)

asd__asdqwe
Beginner
307 Views

Hello,

The minimalist code found here http://en.cppreference.com/w/cpp/utility/functional/function/target cannot be compiled with icpc version 16.0.1 (gcc version 5.0.0 compatibility)

$  icpc -std=c++11 function.cpp                                                                                                 
function.cpp(9): error: class "std::function<int (int, int)>" has no member "target"
      if (arg.target<std::plus<int>>())

Of course, this compiles fine with clang++ and g++, thoughts ?

Thanks.

 

 

0 Kudos
3 Replies
Judith_W_Intel
Employee
307 Views

 

Thanks for the test case and reporting the problem. Indeed it does look like the compiler should be defining the __cpp_rtti feature macro in GNU 5.0 and later compatibility modes. I have entered this our bug tracking database as DPD200381053.

The obvious workaround is to add -D__cpp_rtti to the command line yourself.

Judy

0 Kudos
Kittur_G_Intel
Employee
307 Views

Thanks Judy, I've added the CQ to this thread and will update as soon as the release with the fix is out, appreciate much.

_Kittur

0 Kudos
Kittur_G_Intel
Employee
307 Views

Hi,
Just letting you know that this issue is fixed in the 16.0.3 (update 3) release that was out this week which you can download from the Intel Registration Center and  test it out, thanks.

Regards,
Kittur

0 Kudos
Reply