1 // { dg-options "-pedantic" }
2 // { dg-do compile { target c++11 } }
4 // Bug 115939 - Cannot unambiguously compare iterators in std::unordered_map
6 #include <unordered_map>
14 friend bool operator==(const any_conv
&, const T
&) { return true; }
17 friend bool operator!=(const any_conv
&, const T
&) { return false; }
20 std::unordered_map
<int, any_conv
>::iterator i
{};
21 std::unordered_map
<int, any_conv
>::const_iterator j
{};
22 bool b1
= i
== i
; // { dg-bogus "ambiguous" }
23 bool b2
= j
== j
; // { dg-bogus "ambiguous" }
24 bool b3
= i
== j
; // { dg-bogus "ambiguous" }
25 bool b4
= j
== i
; // { dg-bogus "ambiguous" }
26 bool b5
= i
!= i
; // { dg-bogus "ambiguous" }
27 bool b6
= j
!= j
; // { dg-bogus "ambiguous" }
28 bool b7
= i
!= j
; // { dg-bogus "ambiguous" }
29 bool b8
= j
!= i
; // { dg-bogus "ambiguous" }