[cfe-commits] Patch for review: Parenthesis range in CXXConstructExprs

Daniel Jasper djasper at google.com
Tue Jul 10 01:08:23 PDT 2012


Richard, could you take a look at this? Especially, I am not entirely sure
that this is the right program flow. I now specifically test whether the
Expr inside a CXXFunctionalCastExpr (create by a CastOperation) is a
CXXConstructExpr and set the parenthesis range accordingly. The benefit of
this approach is that it is a very small change and should not have side
effects to other structures. Alternatively, we could probably pass the
parenthesis range into the CastOperation and directly create the
CXXConstructExpr with the correct ParenRange. However, that would be a more
complex change which might have other side effects.


On Mon, Jul 9, 2012 at 3:24 PM, Daniel Jasper <djasper at google.com> wrote:

> I have noticed that the CXXConstructExpr is not always created with the
> correct parenthesis range. For example:
>
> struct X { X(int x) {} };
> void f() {
>   X value(7);  // CXXConstructExpr has correct range (5, 12)
>   X(7);  // CXXConstructExpr has incorrect range (3, 5), does not include
> ")"
> }
>
> Although I am not 100% sure this is a bug and not a feature, the attached
> patch fixes it. Please take a look.
>
> Cheers,
> Daniel
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120710/68dc034e/attachment.html>


More information about the cfe-commits mailing list