re PR libstdc++/53578 (include/ext/concurrence.h relies on ill-formed narrowing conversions)

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

From-SVN: r188646
This commit is contained in:
Jonathan Wakely 2012-06-15 00:27:29 +00:00 committed by Jonathan Wakely
parent e48c9c3e05
commit ea15487933
3 changed files with 11 additions and 4 deletions

View File

@ -1,3 +1,10 @@
2012-06-15 Jonathan Wakely <jwakely.gcc@gmail.com>
PR libstdc++/53578
* include/ext/concurrence.h (__recursive_mutex::_S_destroy): Fix
narrowing conversion.
* include/std/mutex (__recursive_mutex_base::_S_destroy): Likewise.
2012-06-14 Jonathan Wakely <jwakely.gcc@gmail.com>
PR libstdc++/53270

View File

@ -284,7 +284,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// matches a gthr-win32.h recursive mutex
template<typename _Rm>
static typename __enable_if<sizeof(&_Rm::sema), void>::__type
static typename __enable_if<(bool)sizeof(&_Rm::sema), void>::__type
_S_destroy(_Rm* __mx)
{
__gthread_mutex_t __tmp;
@ -293,7 +293,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// matches a recursive mutex with a member 'actual'
template<typename _Rm>
static typename __enable_if<sizeof(&_Rm::actual), void>::__type
static typename __enable_if<(bool)sizeof(&_Rm::actual), void>::__type
_S_destroy(_Rm* __mx)
{ __gthread_mutex_destroy(&__mx->actual); }

View File

@ -116,13 +116,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// matches a recursive mutex with a member 'actual'
template<typename _Rm>
static typename enable_if<sizeof(&_Rm::actual), void>::type
static typename enable_if<(bool)sizeof(&_Rm::actual), void>::type
_S_destroy(_Rm* __mx)
{ __gthread_mutex_destroy(&__mx->actual); }
// matches a gthr-win32.h recursive mutex
template<typename _Rm>
static typename enable_if<sizeof(&_Rm::sema), void>::type
static typename enable_if<(bool)sizeof(&_Rm::sema), void>::type
_S_destroy(_Rm* __mx)
{
__gthread_mutex_t __tmp;