From: Jonathan Wakely Date: Sat, 7 Jul 2012 18:35:52 +0000 (+0000) Subject: re PR libstdc++/53578 (include/ext/concurrence.h relies on ill-formed narrowing conve... X-Git-Tag: releases/gcc-4.6.4~455 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=63ebf06b4f1f24d61e51f28c79037785d07e639b;p=thirdparty%2Fgcc.git 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: r189352 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 6323133f558c..afd687ae4be9 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,10 @@ +2012-07-07 Jonathan Wakely + + PR libstdc++/53578 + * include/ext/concurrence.h (__recursive_mutex::_S_destroy): Fix + narrowing conversion. + * include/std/mutex (__recursive_mutex_base::_S_destroy): Likewise. + 2012-07-05 Jonathan Wakely PR libstdc++/53830 diff --git a/libstdc++-v3/include/ext/concurrence.h b/libstdc++-v3/include/ext/concurrence.h index fc8f63f827e8..4719c84f474f 100644 --- a/libstdc++-v3/include/ext/concurrence.h +++ b/libstdc++-v3/include/ext/concurrence.h @@ -270,7 +270,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // matches a gthr-win32.h recursive mutex template - static typename __enable_if::__type + static typename __enable_if<(bool)sizeof(&_Rm::sema), void>::__type _S_destroy(_Rm* __mx) { __gthread_mutex_t __tmp; @@ -279,7 +279,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // matches a recursive mutex with a member 'actual' template - static typename __enable_if::__type + static typename __enable_if<(bool)sizeof(&_Rm::actual), void>::__type _S_destroy(_Rm* __mx) { __gthread_mutex_destroy(&__mx->actual); } diff --git a/libstdc++-v3/include/std/mutex b/libstdc++-v3/include/std/mutex index 36f894efebb4..ed530e4f03b6 100644 --- a/libstdc++-v3/include/std/mutex +++ b/libstdc++-v3/include/std/mutex @@ -130,7 +130,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION public: // matches a gthr-win32.h recursive mutex template - static typename enable_if::type + static typename enable_if<(bool)sizeof(&_Rm::sema), void>::type _S_destroy(_Rm* __mx) { __gthread_mutex_t __tmp; @@ -139,7 +139,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // matches a recursive mutex with a member 'actual' template - static typename enable_if::type + static typename enable_if<(bool)sizeof(&_Rm::actual), void>::type _S_destroy(_Rm* __mx) { __gthread_mutex_destroy(&__mx->actual); }