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: unassig...@gcc.gnu.org
        ReportedBy: richard-gccbugzi...@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.

Reply via email to