[llvm-bugs] [Bug 41032] parameter passed to std::packaged_task byref stays wrapped with std::reference_wrapper

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Mar 12 15:04:11 PDT 2019


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

Jonathan Wakely <zilla at kayari.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|NEW                         |RESOLVED
                 CC|                            |zilla at kayari.org

--- Comment #6 from Jonathan Wakely <zilla at kayari.org> ---
I think I've figured out what's happening here.

The coliru clang++ defaults to using libstdc++ from GCC 6.x, which internally
used reference_wrapper to pass arguments by reference. That was changed for the
libstdc++ in GCC 7, when I switched to using std::invoke in std::packaged_task.
Using current libstdc++ sources you get the expected behaviour (when compiling
with either Clang or GCC).

So there is no Clang bug, and no libc++ bug (because libc++ isn't even being
used here), just an old libstdc++ bug which was fixed more than two years ago.

Amir, you should probably not report bugs based solely on coliru results, when
you don't know which compiler versions or standard library implementations are
being used. Coluri's clang++ appears to be 5.0.0 so I have no idea where you
got 3.8 from.

-- 
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/20190312/c527e312/attachment.html>


More information about the llvm-bugs mailing list