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

C++11 issue: compile fail. Probably a Bug

Eassa_H_
Beginner
392 Views

The following code returns error on compiling with intel 2016.1.056, on Linux.

#include <chrono>
#include <map>
#include <memory>
#include <thread>
#include <utility>
int main() {
  typedef std::unique_ptr<int> intPointer;
  intPointer p(new int(10));
  std::map<int, std::unique_ptr<int>> m;
  m.insert(std::make_pair(5, std::move(p)));
  auto start = std::chrono::system_clock::now();
  if (std::chrono::system_clock::now() - start < std::chrono::seconds(2))
  {
      std::thread t;
  }
}

Returns error on compile using: 

icpc test.cpp -std=c++11 -Wl,-rpath,/share/apps/intel/2016.1.056/advisor_xe_2016/lib64

the error:

In file included from /share/apps/gcc/6.3.0/include/c++/6.3.0/map(60),
                 from test.cpp(2):
/share/apps/gcc/6.3.0/include/c++/6.3.0/bits/stl_tree.h(1437): error: identifier "_Compare" is undefined
           && is_nothrow_move_assignable<_Compare>::value)
                                                                  ^

In file included from /share/apps/gcc/6.3.0/include/c++/6.3.0/map(60),
                 from test.cpp(2):
/share/apps/gcc/6.3.0/include/c++/6.3.0/bits/stl_tree.h(1778): error: identifier "_Compare" is undefined
      _GLIBCXX_NOEXCEPT_IF(__is_nothrow_swappable<_Compare>::value)
      ^

While compiling with gcc goes well.

0 Kudos
2 Replies
Yuan_C_Intel
Employee
392 Views

Hi, Eassa

Are you using gcc6.3 on Mac OS X? Intel C++ compiler 16.0 does not support gcc 6 yet.

Please upgrade to Intel C++ Compiler 17.0 to try.

Thanks.

0 Kudos
Eassa_H_
Beginner
392 Views

Thanks for reply,

That make sense, it's on Linux though, but the compatibility problem is valid.

0 Kudos
Reply