https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80034
Bug ID: 80034 Summary: [5/6 Regression] unqualified calls to std::distance in std::list::sort Product: gcc Version: 6.3.1 Status: UNCONFIRMED Keywords: rejects-valid Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: redi at gcc dot gnu.org CC: ville at gcc dot gnu.org Target Milestone: --- This no longer compiles on the gcc-5 or gcc-6 branches: #include <list> namespace X { struct Y { }; bool operator<(Y, Y) { return false; } template<typename T> void distance(T, T) { } } int main() { std::list<X::Y> l; l.sort(); } Caused by r244475 and r244474