[PATCH] libstdc++: Avoid accidental ADL when calling make_reverse_iterator

Moritz Sichert sichert@in.tum.de
Wed Mar 3 17:25:48 GMT 2021


std::ranges::reverse_view uses make_reverse_iterator in its
implementation as described in [range.reverse.view]. This accidentally
allows ADL as an unqualified name is used in the call. According to
[contents], however, this should be treated as a qualified lookup into
the std namespace.

This leads to errors due to ambiguous name lookups when another
make_reverse_iterator function is found via ADL.

I found this as llvm has its own implementation of ranges which also has llvm::make_reverse_iterator. This lead to a compile error with std::vector<llvm::Value*> | std::ranges::views::reverse.

Best,
Moritz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libstdc-Avoid-accidental-ADL-when-calling-make_rever.patch
Type: text/x-patch
Size: 4429 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/libstdc++/attachments/20210303/a9c7ed57/attachment.bin>


More information about the Libstdc++ mailing list