This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] PR libstdc++/84532 prevent unwrapping of reference_wrapper arguments


When I refactored the std::thread internals I made it use
std::make_tuple, which rather than just DECAY_COPYing the arguments it
also unwraps any std::reference_wrapper arguments, which is wrong.
This constructs a std::tuple of the decayed types, instead of using
make_tuple, so that reference_wrapper arguments are preserved (and
convert to the wrapped type on invocation, if required).

        PR libstdc++/84532
        * include/std/thread (thread::__make_invoker): Construct tuple
        directly instead of using make_tuple.
        * testsuite/30_threads/async/84532.cc: New.
        * testsuite/30_threads/thread/84532.cc: New.

Tested x86_64-linux, committed to trunk. Backport to gcc-7-branch will follow.

Attachment: patch.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]