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

Olaf Krzikalla Olaf.Krzikalla at tu-dresden.de
Mon Jun 29 09:06:28 PDT 2009


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.
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.
3. When I try to rewrite a freestanding expression I have trouble with 
the semicolon. Example:
{ expr; }
The semicolon is obv. not included in the source range of expr. But the 
parent of expr is already the CompoundStmt meaning that there seems to 
be no place to hold the information about the semicolon at all. Actually 
an encapsulating helper statement would be needed or there is a more 
clever solution. But maybe I just have to take this as a known limitation.
4. Why takes the FloatingLiteral ctor the "isexact" bool variable as a 
pointer?
5. Is it possible to change the PrinterHelper::handledStmt function so 
that it takes the current indentation as a third argument?

That's for now. Maybe someone can shed some light on some of these points.

Best
Olaf Krzikalla




More information about the cfe-dev mailing list