Skip to content

Fix build issue with newer versions of gcc #50

@mmatsa

Description

@mmatsa

Error as reported:

/usr/include/c++/10/bits/hashtable.h:192:21: error: static assertion failed: unordered container must have the same value_type as its allocator
  192 |       static_assert(is_same<typename _Alloc::value_type, _Value>{},
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/10/bits/hashtable.h:308:21: error: static assertion failed: Cache the hash code or qualify your functors involved in hash code and bucket index computation with noexcept
  308 |       static_assert(noexcept(declval<const __hash_code_base_access&>()
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  309 |         ._M_bucket_index((const __node_type*)nullptr,
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  310 |            (std::size_t)0)),
      |            ~~~~~~~~~~~~~~~~

Fix to mapterm.h:

396c396
< 		typedef std::unordered_map<K*, V*, std::hash<K*>, std::equal_to<K*>, Allocator<std::pair<const K*, V*>>> tsmap;
---
> 		typedef std::unordered_map<K*, V*, std::hash<K*>, std::equal_to<K*>, Allocator<std::pair<K* const, V*>>> tsmap;
406c406
<         CMapTerm(Context& ctx, CMapTerm& parent): map(10, std::hash<K*>(), std::equal_to<K*>(), Allocator<std::pair<const K*, V*>>(ctx)), parent(make_optional<CMapTerm>(parent))
---
>         CMapTerm(Context& ctx, CMapTerm& parent): map(10, std::hash<K*>(), std::equal_to<K*>(), Allocator<std::pair<K* const, V*>>(ctx)), parent(make_optional<CMapTerm>(parent))

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions