[cfe-dev] why does ForStmt have a CondVar field?

Ted Kremenek kremenek at apple.com
Wed Dec 23 17:50:06 PST 2009


On Dec 23, 2009, at 5:21 PM, Eli Friedman wrote:

> On Wed, Dec 23, 2009 at 5:08 PM, Ted Kremenek <kremenek at apple.com> wrote:
>> I noticed that ForStmt has a CondVar field, similar to the condition variable field for IfStmt and WhileStmt.  Unlike these other Stms, however, ForStmt uses a DeclStmt for the initialization expression.  From what I can tell, the CondVar field in ForStmt is always NULL.
>> 
>> Is it needed?  It also doesn't make semantic sense, since there is no notion of one condition variable, as one can declare multiple variables in the initialization of the ForStmt.
> 
> void a() { for (int x = 0;int y = x;x++) {} }
> 
> -Eli

Right, thanks Eli.



More information about the cfe-dev mailing list