https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71771
Bug ID: 71771 Summary: DR 685 applied incorrectly Product: gcc Version: 7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: Casey at Carter dot net Target Milestone: --- The resolution of LWG DR 685 (http://cplusplus.github.io/LWG/lwg-defects.html#685) *replaces* the non-member operator- of reverse_iterator and move_iterator with a cross-type overload constrained via expression SFINAE on the return type. libstdc++ trunk adds the cross-type overload for reverse_iterator, but *leaves the old single-type overload in place*, so operator- does not properly SFINAE for two reverse_iterators with the same (non-differentiable) base type. move_iterator also has the new cross-type overload, its old single-type overload has been left in place but constrained similarly. While technically conforming, the result is that for a move_iterator i, "i - {}" and "{} - i" will match this old single-type overload instead of being ill-formed.