This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/30277] bit-field: wrong overload resolution



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]