diff --git a/llvm/include/llvm/ADT/STLExtras.h b/llvm/include/llvm/ADT/STLExtras.h --- a/llvm/include/llvm/ADT/STLExtras.h +++ b/llvm/include/llvm/ADT/STLExtras.h @@ -1506,6 +1506,9 @@ template class enumerator_iter; template struct result_pair { + using value_reference = + typename std::iterator_traits>::reference; + friend class enumerator_iter; result_pair() = default; @@ -1519,8 +1522,8 @@ } std::size_t index() const { return Index; } - const ValueOfRange &value() const { return *Iter; } - ValueOfRange &value() { return *Iter; } + const value_reference value() const { return *Iter; } + value_reference value() { return *Iter; } private: std::size_t Index = std::numeric_limits::max();