[cfe-dev] Constants.cpp assertion raised

Chris Lattner clattner at apple.com
Wed Jan 9 13:18:34 PST 2008


On Jan 9, 2008, at 1:17 PM, Oliver Hunt wrote:
> I would actually expect this to work in the current global init  
> code.  I suspect the code isn't check for implicit conversions or  
> some such...  although that surprises me.

The problem is that the implicit conversion isn't being emitted.  For  
reference, this does codegen correctly:

typedef struct {
unsigned char c;
} t;

const t x = { (unsigned char)1 };



Note the explicit cast to char.

-Chris



More information about the cfe-dev mailing list