[cfe-dev] Source locations for ? and : in ConditionalOperator.

Enea Zaffanella zaffanella at cs.unipr.it
Tue Aug 25 09:08:09 PDT 2009


Hello.

We would like to provide the AST node for ConditionalOperator with 
source location info for the ? and : tokens.

Besides matching our own needs, the addition of these locations will 
allow for the removal of the following FIXME in lib/Sema/TreeTransform.h:

   // FIXM: ? and : locations are broken.
   SourceLocation FakeQuestionLoc = E->getCond()->getLocEnd();
   SourceLocation FakeColonLoc = E->getFalseExpr()->getLocStart();
   return getDerived().RebuildConditionalOperator(move(Cond),
                                                  FakeQuestionLoc,
                                                  move(LHS),
                                                  FakeColonLoc,
                                                  move(RHS));

Is that OK also from the point of view of clang developers?

Cheers,
Enea Zaffanella.



More information about the cfe-dev mailing list