<div dir="ltr">Thanks Eric. I guess this could use a bug report. I searched existing bug reports, but I did not find anything about it. Are you involved in development of libc++?<div><br></div><div>Thank you,</div><div>Marcin</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Oct 11, 2019 at 6:28 PM Eric Fiselier <<a href="mailto:eric@efcs.ca">eric@efcs.ca</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div dir="auto"></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Oct 9, 2019, 12:40 AM Marcin Zalewski via libcxx-dev <<a href="mailto:libcxx-dev@lists.llvm.org" rel="noreferrer noreferrer noreferrer" target="_blank">libcxx-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I have a library that redefines forward_as_tuple in its namespace, along with some concrete types. This causes the problem with the following code:<div><br></div><div><a href="https://github.com/llvm/llvm-project/blob/master/libcxx/include/tuple#L1352" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">https://github.com/llvm/llvm-project/blob/master/libcxx/include/tuple#L1352</a><br></div><div><a href="https://github.com/llvm/llvm-project/blob/master/libcxx/include/tuple#L1367" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">https://github.com/llvm/llvm-project/blob/master/libcxx/include/tuple#L1367</a><br></div><div><br></div><div>Here, forward_as_tuple is being called unqualified, and ADL kicks in. ADL finds the definition of forward_as_tuple in the library that I am using, and I get ambiguity. </div><div><br></div><div>It definitely can be argued that the library I am using makes a dangerous choice by sticking concrete types into the same namespace as the template forward_as_tuple, but it does. My question is why libc++ calls forward_as_tuple unqualified rather than std::forward_as_tuple. Is this a bug, or is there a good reason for this?</div></div></blockquote></div><div dir="auto"><br></div><div dir="auto">This is a bug in libc++. </div><div dir="auto"><br></div><div dir="auto">Apart from customization points like `swap`, libc++ should never use ADL, even when calling functions with reserved names.</div><div dir="auto"><br></div><div dir="auto"> I'm working on a Clang tool to clean up ADL-using call expressions. I'll run it over libc++ </div><div dir="auto"><br></div><div class="gmail_quote" dir="auto"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><br></div><div>Thanks,</div><div>Marcin</div></div>
_______________________________________________<br>
libcxx-dev mailing list<br>
<a href="mailto:libcxx-dev@lists.llvm.org" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">libcxx-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/libcxx-dev" rel="noreferrer noreferrer noreferrer noreferrer noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/libcxx-dev</a><br>
</blockquote></div></div>
</blockquote></div>