[Bug libstdc++/60448] swap_ranges does not use ADL correctly

glisse at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Mar 6 16:59:00 GMT 2014


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60448

--- Comment #7 from Marc Glisse <glisse at gcc dot gnu.org> ---
(In reply to Marc Glisse from comment #6)
> libc++ sfinae constrains std::swap.

More precisely: they do have swap declared before iter_swap, if you remove the
=delete it is ambiguous with libc++ as well, it just happens that the template
constraints disable the std swap in this particular case.

So I don't think libstdc++ is doing anything wrong.

I don't understand why ADL should get this to work. No function is more
specialized than the other, and ADL doesn't disable unqualified lookup. But
then again I am bad at understanding this text, it looks to me like it says ADL
shouldn't even happen, which is clearly not the case...



More information about the Gcc-bugs mailing list