This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/30277] bit-field: wrong overload resolution
- From: "joseph at codesourcery dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Jan 2007 12:28:33 -0000
- Subject: [Bug c++/30277] bit-field: wrong overload resolution
- References: <bug-30277-10812@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from joseph at codesourcery dot com 2007-01-21 12:28 -------
Subject: Re: bit-field: wrong overload resolution
On Sun, 21 Jan 2007, bangerth at dealii dot org wrote:
> I only have the C99 standard, and there I read in 6.3.1.1 p2 that only
> those variables are promoted to int that are of smaller size.
C and C++ handle bit-fields differently. C99 text about bit-fields is
irrelevant and misleading for C++.
In C++03, integral promotions for bit-fields are specified in 4.5
[conv.prom] (note these are "can be converted", as part of a conversion
sequence; the underlying concepts are not those of C), and before any such
conversion a C++ bit-field has the declared type as per 9.6 [class.bit]
rather than a special type as in C.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30277