Commit 12763abc by Jakub Jelinek Committed by Jakub Jelinek

re PR bootstrap/86739 (Bootstrap broken with host GCC 4.1.2)

	PR bootstrap/86739
	* hash-map.h (hash_map::iterator::reference_pair): New class.
	(hash_map::iterator::operator*): Return it rather than std::pair.

From-SVN: r266152
parent c933b893
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
......@@ -223,10 +223,23 @@ public:
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
......
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