]> git.ipfire.org Git - thirdparty/gcc.git/commit
PR libstdc++/81266 fix std::thread::native_handle_type test
authorJonathan Wakely <jwakely@redhat.com>
Sat, 11 May 2019 11:35:59 +0000 (12:35 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Sat, 11 May 2019 11:35:59 +0000 (12:35 +0100)
commita301651022734f4a0f744d4c2ebe8a77f27abf5a
treeb5b5384ca9b50b29610682f1ed30351077bba3c8
parentc4de1839668f04ec5d62e1f9cfcf9c1a86febaaa
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.

Backport from mainline
2019-05-10  Jonathan Wakely  <jwakely@redhat.com>

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

From-SVN: r271094
libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/util/thread/all.h