Jonathan Wakely | 15 Jun 2012 02:27
Picon

[v3] fix PR 53578 invalid narrowing conversion

This fixes an invalid narrowing conversion that causes problems when
libstdc++ is used with clang++ on non-pthreads targets.

        PR libstdc++/53578
        * include/ext/concurrence.h (__recursive_mutex::_S_destroy): Fix
        narrowing conversion.
        * include/std/mutex (__recursive_mutex_base::_S_destroy): Likewise.

Tested x86_64-linux with _GTHREAD_USE_RECURSIVE_MUTEX_INIT_FUNC
defined so the code is executed. Committed to trunk.
commit 583eb7d9fdcf5365c286fd85c0b43406a9ce46ef
Author: Jonathan Wakely <jwakely.gcc <at> gmail.com>
Date:   Fri Jun 15 01:01:03 2012 +0100

    	PR libstdc++/53578
    	* include/ext/concurrence.h (__recursive_mutex::_S_destroy): Fix
    	narrowing conversion.
    	* include/std/mutex (__recursive_mutex_base::_S_destroy): Likewise.

diff --git a/libstdc++-v3/include/ext/concurrence.h b/libstdc++-v3/include/ext/concurrence.h
index 22c433b..25e218b 100644
--- a/libstdc++-v3/include/ext/concurrence.h
+++ b/libstdc++-v3/include/ext/concurrence.h
 <at>  <at>  -284,7 +284,7  <at>  <at>  _GLIBCXX_BEGIN_NAMESPACE_VERSION

     // matches a gthr-win32.h recursive mutex
     template<typename _Rm>
-      static typename __enable_if<sizeof(&_Rm::sema), void>::__type
(Continue reading)


Gmane