[Bug target/81266] FAIL: 30_threads/thread/native_handle/typesizes.cc execution test on darwin

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri May 10 21:42:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81266

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Author: redi
Date: Fri May 10 21:41:23 2019
New Revision: 271080

URL: https://gcc.gnu.org/viewcvs?rev=271080&root=gcc&view=rev
Log:
PR libstdc++/81266 fix std::thread::native_handle_type test

The test uses remove_pointer because in most cases native_handle_type is
a pointer to the actual type that the C++ class contains. However, for
std::thread, native_handle_type is the same type as the type contained
in std::thread, and so remove_pointer is not needed. On targets where
pthread_t is a pointer type remove_pointer<native_handle_type> is not a
no-op, instead it transforms pthread_t and causes the test to fail.

The fix is to not apply remove_pointer when testing std::thread.

        PR libstdc++/81266
        * testsuite/util/thread/all.h: Do not use remove_pointer for
        std::thread::native_handle_type.

Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/testsuite/util/thread/all.h


More information about the Gcc-bugs mailing list