<div>This looks fine. Please also provide a new testcase for unittests/AST/SourceLocationTest.cpp.</div><br><div class="gmail_quote">On Fri, Feb 1, 2013 at 5:29 PM, John Stratton <span dir="ltr"><<a href="mailto:john@multicorewareinc.com" target="_blank">john@multicorewareinc.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks for the feedback.  Here's an updated patch.  To some extent,<br>
yes, this situation is weird, but I think the only valid input<br>
exercising this code path should are cases where it would have been<br>
semantically equivalent to braces anyway.<br>
<span class="HOEnZb"><font color="#888888"><br>
--John<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On 1/30/13, Richard Smith <<a href="mailto:richard@metafoo.co.uk">richard@metafoo.co.uk</a>> wrote:<br>
> On Wed, Jan 30, 2013 at 10:57 AM, John Stratton<br>
> <<a href="mailto:john@multicorewareinc.com">john@multicorewareinc.com</a>> wrote:<br>
>> Hello.  I've attached a small patch that fixes the 15095 bug I filed a<br>
>> couple of days ago, and makes sure that the CompoundLiteral and child<br>
>> AST nodes created from a vector literal have correct source-location<br>
>> information.  Does this make sense to the veteran Clang developers?<br>
><br>
> It's a bit weird that we're building a CompoundLiteralExpr here for a<br>
> construct which used parentheses not braces, but given that's our<br>
> representation, it seems appropriate to pretend the braces are where<br>
> the parens of the initializer were.<br>
><br>
> +  if (isVectorLiteral) {<br>
> +    SourceLocation litLParenLoc = (PE ? PE->getLParen() :<br>
> PLE->getLParenLoc());<br>
> +    SourceLocation litRParenLoc = (PE ? PE->getRParen() :<br>
> PLE->getRParenLoc());<br>
><br>
> Please compute these locations in BuildVectorLiteral instead (within<br>
> its 'if (ParenListExpr *PE = dyn_cast<ParenListExpr>(E))' code).<br>
><br>
> Also, variable names should start with an uppercase letter (this code<br>
> breaks the convention in a few places, but new code should conform).<br>
><br>
</div></div></blockquote></div><br>