+2018-11-14 Jakub Jelinek <jakub@redhat.com>
+
+ PR bootstrap/86739
+ * hash-map.h (hash_map::iterator::reference_pair): New class.
+ (hash_map::iterator::operator*): Return it rather than std::pair.
+
2018-11-14 Jeff Law <law@redhat.com>
* optabs.c (expand_binop): Pass INT_MODE to operand_subword_force
return *this;
}
- std::pair<const Key&, Value&> operator* ()
+ /* Can't use std::pair here, because GCC before 4.3 don't handle
+ std::pair where template parameters are references well.
+ See PR86739. */
+ struct reference_pair {
+ const Key &first;
+ Value &second;
+
+ reference_pair (const Key &key, Value &value) : first (key), second (value) {}
+
+ template <typename K, typename V>
+ operator std::pair<K, V> () const { return std::pair<K, V> (first, second); }
+ };
+
+ reference_pair operator* ()
{
hash_entry &e = *m_iter;
- return std::pair<const Key&, Value&> (e.m_key, e.m_value);
+ return reference_pair (e.m_key, e.m_value);
}
bool