[cfe-dev] A bunch of more or less related issues

Olaf Krzikalla Olaf.Krzikalla at tu-dresden.de
Tue Jun 30 03:06:19 PDT 2009

Hi @clang,

take this post as an answer to all responses.

Eli Friedman schrieb:
> On Mon, Jun 29, 2009 at 9:06 AM, Olaf
> Krzikalla<Olaf.Krzikalla at tu-dresden.de> wrote:
>> Hi @clang,
>> while working on AST processing I stumbled over the one or another
>> little quirk. I like to point them out now before the list becomes too long:
>> 1. Why StmtPrinter::Indent always indent with two spaces hence
>> effectively doubling the indent? It cost me a while to find that out as
>> it is IMHO unexprected.
> From a brief investigation, I think that's simply a bug; patch welcome.
OK. I hope it's not a big problem, since existing code works a little
bit different after the change, i.e. it doesn't conform to the 'one true
way' by default anymore ;).

>> 2. What is the full expression according to ISO in "if (int a = expr)"?
>> IMHO it is expr, but I'm not really sure since I saw CXXConditionDeclExpr.
> ISO isn't really relevant here, I think.  The way the AST is
> structured, the if statement contains an CXXConditionDeclExpr, which
> references the decl; "expr" is simply the intialializer for "a".
This one I should elaborate: what I have here is a new function
ParentMap::getFullExpression. At the moment this function simply
traverses the parent statement tree until a non-expr statement is found.
Of course I want to have the function doing its thing right, that is
yield the full expression according to ISO. Thatswhy I'm asking: IMHO  I
should handle CXXConditionDeclExpr like a non-expr statement, but I'm
only 99% sure.

For the rest I'm going to post patches in the near future (probably
despite the seimcolon issue).

Olaf Krzikalla

More information about the cfe-dev mailing list