[cfe-dev] check an AST node's parent node ?

kevinlynx kevinlynx at gmail.com
Mon Jan 7 22:48:38 PST 2013


In my coding standard checking tool, it limits comma expression usage, except in a for statment, i.e:

    x++, x+=1; // this will be marked as invalid usage
    for (x = 0, y = 0; ...) // but this comma expression is valid

I can implement `VisitBinComma`, this function will be called when parsed comma expression. But how to know if this comma expression is in a for statment ?

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130108/8ebe8847/attachment.html>


More information about the cfe-dev mailing list