Commit 2c877186 authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

Workaround for clang bug

parent eb8deeaa
Pipeline #181 failed with stage
......@@ -693,7 +693,7 @@ struct get_augmented_overlap
for (auto v : vertices_range(g))
{
size_t vi = node_index[v];
auto br = std::make_tuple(b[v], vi);
auto br = std::make_tuple(int(b[v]), int(vi));
size_t idx;
auto iter = idx_map.find(br);
if (iter != idx_map.end())
......@@ -704,7 +704,6 @@ struct get_augmented_overlap
{
idx = pos;
idx_map[br] = pos++;
idx_rmap.push_back(br);
}
br_map[v] = idx;
}
......
......@@ -341,6 +341,18 @@ public:
void resize(size_t n) { base_t::reserve(n); }
#endif
#if !defined(HAVE_SPARSEHASH) && defined(__clang__)
// this is a workaround for a bug in clang:
// https://llvm.org/bugs/show_bug.cgi?id=24770
// https://llvm.org/bugs/show_bug.cgi?id=14858
Value& operator[](const Key& key )
{
auto iter = this->find(key);
if (iter == this->end())
iter = this->insert({key, Value()}).first;
return iter->second;
}
#endif
};
#endif // HASH_MAP_WRAP_HH
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment