[PATCH] Fix PR c/11658

Joseph S. Myers jsm@polyomino.org.uk
Sat Feb 21 13:45:00 GMT 2004


On Mon, 2 Feb 2004, Paolo Bonzini wrote:

> struct s { char c[1]; };
> struct s a;
> 
> int bug_cond2(void) { return (a.c ? : 0); }  /* { dg-error "array that cannot be converted" } */

I don't think this is a correct error; a.c clearly is an lvalue array;  
the only error should be that this function as written is returning a
pointer to char but has the wrong return type for that.  Probably the
parser handling of this extension should be calling default_conversion
before save_expr.

Also, please avoid use the empty structs and unions extension in these
testcases; it isn't necessary for them; and make those testing arrays 
explicitly specify -std=gnu89.

-- 
Joseph S. Myers
jsm@polyomino.org.uk



More information about the Gcc-patches mailing list