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.<div class="gmail_extra">
<br><br><div class="gmail_quote">On Mon, Jul 9, 2012 at 3:24 PM, Daniel Jasper <span dir="ltr"><<a href="mailto:djasper@google.com" target="_blank">djasper@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I have noticed that the CXXConstructExpr is not always created with the correct parenthesis range. For example:<div><br></div><div><div>struct X { X(int x) {} };</div><div>void f() {</div><div>  X value(7);  // CXXConstructExpr has correct range (5, 12)</div>

<div>  X(7);  // CXXConstructExpr has incorrect range (3, 5), does not include ")"</div><div>}</div></div><div><br></div><div>Although I am not 100% sure this is a bug and not a feature, the attached patch fixes it. Please take a look.</div>

<div><br></div><div>Cheers,<br>Daniel</div><div><br></div><div><br></div>
</blockquote></div><br></div>