[cfe-dev] InitListExpr with void type

Sebastian Redl sebastian.redl at getdesigned.at
Tue Jan 27 15:06:38 PST 2009


Ted Kremenek wrote:
> Today I was running the latest build of the static analyzer over the  
> Wine sources and noticed a crash in its handling of InitListExprs.  I  
> won't go into the gory details; essentially there are cases where an  
> InitListExpr can have type 'void' and this is a case the analyzer does  
> not (yet) handle.
>
> My question is whether or not it is valid for InitListExprs to have a  
> 'void' type, and if so, how should they be interpreted?
>   
I'm pretty sure InitListExprs pretty much *always* have void type, due
to these lines in Sema::ActOnInitList:

>   InitListExpr *E = new (Context) InitListExpr(LBraceLoc, InitList,
> NumInit,
>                                     RBraceLoc,
> Designators.hasAnyDesignators());
>   E->setType(Context.VoidTy); // FIXME: just a place holder for now.

Sebastian



More information about the cfe-dev mailing list