Quantcast
Channel: Intel® Software - Intel® C++ Compiler
Viewing all articles
Browse latest Browse all 1175

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

$
0
0

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.

Thread Topic: 

Bug Report

Viewing all articles
Browse latest Browse all 1175

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>