- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
icc version 16.0.1 w/ gcc 4.8.3 compatibility:
cpc -v -E -x c++ - < /dev/null |& head -n1 icpc version 16.0.1 (gcc version 4.8.3 compatibility)
cannot compile the following snippet of code (simplification of a more complex code):
#include <unordered_map> using key=const int;//std::pair<const int*,const int*>; struct Myhash { Myhash() = default; std::hash<int> hash_int_t; inline size_t operator()(const key& x) const throw() { return hash_int_t(x); } }; std::unordered_map<key,int,Myhash> mm;
emitting the following error (the problem is in the hash_int_t variable):
icpc -std=c++11 -c unordered_map.cc /opt/gcc-4.8.3/include/c++/4.8.3/bits/hashtable.h(268): error: static assertion failed with "Cache the hash code or make functors involved in hash code and bucket index computation default constructible" static_assert(__if_hash_not_cached< ^ [...omissis...]
The same snippet of code can be compiled by icc with gcc 4.9 compatibility layer.
Is this a known bug/issue?
Thank you,
Andrea Dotti
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Andrea,
Yes, you're correct it compiles fine with gcc4.9. Let me look into this and update you accordingly, thx
Regards,
Kittur
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Andrea,
Yes this is bug in the compiler and I've filed an issue with our developers (DPD200410621) and will update you as soon as the release with the fix is out. Appreciate your patience till then.
Regards,
Kittur

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page