C++ PATCH: PR 26534

Joseph S. Myers joseph@codesourcery.com
Sun Apr 23 21:28:00 GMT 2006


On Sun, 23 Apr 2006, Mark Mitchell wrote:

> Joseph S. Myers wrote:
> > On Sun, 23 Apr 2006, Mark Mitchell wrote:
> > 
> >> that the type of "x.i" be "int".  When "x.i" is used in an rvalue
> >> context, we convert it to the declared type; the middle end should be
> > 
> > Properly, this should be converting to the declared type for a bit-field 
> > strictly wider than int or one of enumerated type, otherwise to either int 
> > or unsigned int depending on whether int can represent all values of the 
> > bit-field; [conv.prom] paragraph 3 and bug 16376.
> 
> Yes, the integral promotions will happen as well, at a later stage.  So,
> for something like "short i : 3", "x.i" will first be converted to
> "short", and then it will be promoted to "int".

Equally, "unsigned long i : 3" should also be promoted to int, not 
unsigned long.  Now, Andrew Pinski is reporting that this patch is indeed 
fixing bug 16376, whether or not intended to do so.

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Gcc-patches mailing list