[cfe-dev] clang::CompoundLiteral::getInitializer() should use cast_or_null() (or I am missing something)

Paolo Bolzoni bolzoni at cs.unipr.it
Tue Dec 16 13:21:15 PST 2008


dear list,

I am working with .c files that uses the GNU extensions, in particular
the diag::ext_gnu_empty_initializer related extension.

Unfortunately this means the Stmt* Init of the class may be zero.

When it is the case getInitializer() crashes because cast() is not meant
to be used on null pointers.

It really seems a bug, but I am not posting a bug report because I read
in the class body this intriguing comment:
    // FIXME: Init should never be null.

What is the story then? How emtpy initializer finish in the AST?

Thanks,
pb



More information about the cfe-dev mailing list