<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><span class="vcard"><a class="email" href="mailto:zilla@kayari.org" title="Jonathan Wakely <zilla@kayari.org>"> <span class="fn">Jonathan Wakely</span></a>
</span> changed
          <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - parameter passed to std::packaged_task byref stays wrapped with std::reference_wrapper"
   href="https://bugs.llvm.org/show_bug.cgi?id=41032">bug 41032</a>
          <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>INVALID
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>NEW
           </td>
           <td>RESOLVED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">CC</td>
           <td>
                
           </td>
           <td>zilla@kayari.org
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - parameter passed to std::packaged_task byref stays wrapped with std::reference_wrapper"
   href="https://bugs.llvm.org/show_bug.cgi?id=41032#c6">Comment # 6</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - parameter passed to std::packaged_task byref stays wrapped with std::reference_wrapper"
   href="https://bugs.llvm.org/show_bug.cgi?id=41032">bug 41032</a>
              from <span class="vcard"><a class="email" href="mailto:zilla@kayari.org" title="Jonathan Wakely <zilla@kayari.org>"> <span class="fn">Jonathan Wakely</span></a>
</span></b>
        <pre>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.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>