On 14/11/18 09:25 +0100, Richard Biener wrote:
On Wed, 14 Nov 2018, Jakub Jelinek wrote:

Hi!

As mentioned in the PR, with GCC before 4.3 one can't instantiate std::pair
where one or both of the template parameters are reference types, because
the std::pair constructor has arguments references to the template parameter
types and the CWG that resolved hasn't been applied to those compilers.

The following patch works around it by not returning
std::pair<const Key &, Value &> object, but instead a different class that
holds the two references and has conversion operator to std::pair.

If that conversion operator isn't acceptable, in the PR there is another
patch which adjusts the (so far) two spots which need to be changed in that
case.

Bootstrapped/regtested on x86_64-linux and i686-linux (using GCC 7 as
bootstrap compiler) and tested on the preprocessed source with GCC 4.1.
Ok for trunk?

Works for me if C++ people have no better idea.

Looks good to me.

Reply via email to