This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/53578] New: include/ext/concurrence.h relies on ill-formed narrowing conversions
- From: "richard-gccbugzilla at metafoo dot co.uk" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 04 Jun 2012 23:52:47 +0000
- Subject: [Bug libstdc++/53578] New: include/ext/concurrence.h relies on ill-formed narrowing conversions
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53578
Bug #: 53578
Summary: include/ext/concurrence.h relies on ill-formed
narrowing conversions
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: richard-gccbugzilla@metafoo.co.uk
>From around line 271 of ext/concurrence.h:
// matches a gthr-win32.h recursive mutex
template<typename _Rm>
static typename __enable_if<sizeof(&_Rm::sema), void>::__type
_S_destroy(_Rm* __mx)
This SFINAE device doesn't work in Clang in C++11 mode, because the sizeof
expression evaluates to a value greater than one, and thus the implicit
conversion to bool for the first template parameter is a narrowing conversion.
I assume g++ will hit this too once it adds support for the narrowing check in
converted constant expressions.