[llvm-bugs] [Bug 52454] New: ADL broken with clang 13.0.0

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Nov 9 12:24:25 PST 2021


https://bugs.llvm.org/show_bug.cgi?id=52454

            Bug ID: 52454
           Summary: ADL broken with clang 13.0.0
           Product: clang
           Version: 13.0
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: dodoentertainment at gmail.com
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

Here is the Godbolt link that reproduces the issue that I've stumbled upon in
my codebase: https://godbolt.org/z/ocMdcxj89

Namely, the code uses ADL to inject a custom implementation of swap for the
boost iterator_facade (the swap is needed for `std::sort` to work).

This works great on GCC and MSVC and worked also on clang until v13.0.0 when it
stopped working.

You can see the error in the above Godbolt link.

Interestingly, if I replace `std::sort` with `boost::sort::pdqsort`, the same
implementation of swap can now be found using ADL.

You can see this in this example: https://godbolt.org/z/r8eMbY5r4

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20211109/0c20942e/attachment.html>


More information about the llvm-bugs mailing list