public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/53578] New: include/ext/concurrence.h relies on ill-formed narrowing conversions
@ 2012-06-04 23:53 richard-gccbugzilla at metafoo dot co.uk
  2012-06-04 23:55 ` [Bug libstdc++/53578] " pinskia at gcc dot gnu.org
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: richard-gccbugzilla at metafoo dot co.uk @ 2012-06-04 23:53 UTC (permalink / raw)
  To: gcc-bugs

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.


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2012-07-07 18:37 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-04 23:53 [Bug libstdc++/53578] New: include/ext/concurrence.h relies on ill-formed narrowing conversions richard-gccbugzilla at metafoo dot co.uk
2012-06-04 23:55 ` [Bug libstdc++/53578] " pinskia at gcc dot gnu.org
2012-06-05  0:00 ` pinskia at gcc dot gnu.org
2012-06-05  0:05 ` paolo.carlini at oracle dot com
2012-06-05  0:24 ` redi at gcc dot gnu.org
2012-06-06 10:25 ` vanboxem.ruben at gmail dot com
2012-06-06 10:43 ` redi at gcc dot gnu.org
2012-06-06 10:46 ` redi at gcc dot gnu.org
2012-06-06 11:10 ` vanboxem.ruben at gmail dot com
2012-06-06 11:21 ` redi at gcc dot gnu.org
2012-06-15  0:27 ` redi at gcc dot gnu.org
2012-06-15  0:28 ` redi at gcc dot gnu.org
2012-06-15  0:29 ` redi at gcc dot gnu.org
2012-06-29  8:17 ` redi at gcc dot gnu.org
2012-06-29 14:16 ` internet at 123gen dot com
2012-07-07 18:13 ` redi at gcc dot gnu.org
2012-07-07 18:36 ` redi at gcc dot gnu.org
2012-07-07 18:36 ` redi at gcc dot gnu.org
2012-07-07 18:37 ` redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).