<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Oct 22, 2014 at 2:44 PM, Aaron Ballman <span dir="ltr"><<a href="mailto:aaron@aaronballman.com" target="_blank">aaron@aaronballman.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Wed, Oct 22, 2014 at 5:21 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> wrote:<br>
> My only quandry is: what other things can the body be? If CompoundStmt and<br>
> and CXXTryStmt are the only ones, then we can remove the conditional<br>
> entirely.<br>
<br>
</span>I think we can remove that conditional. IssueWarnings calls getBody()<br>
on the Decl passed in from PopFunctionScopeInfo, and that should<br>
always be something function-like, and I can't think of a situation<br>
where we'd get something other than a CompoundStmt or CXXTryStmt.<br>
<br>
Richard, can you think of any situations that would be problematic?</blockquote><div><br></div><div>No, the body of a function is always one of those two things.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="HOEnZb"><font color="#888888">
~Aaron<br>
</font></span><div class="HOEnZb"><div class="h5">><br>
> On Wed, Oct 22, 2014 at 2:18 PM, Aaron Ballman <<a href="mailto:aaron@aaronballman.com">aaron@aaronballman.com</a>><br>
> wrote:<br>
>><br>
>> On Wed, Oct 22, 2014 at 5:08 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> wrote:<br>
>> ><br>
>> ><br>
>> > On Wed, Oct 22, 2014 at 2:01 PM, Aaron Ballman <<a href="mailto:aaron@aaronballman.com">aaron@aaronballman.com</a>><br>
>> > wrote:<br>
>> >><br>
>> >> On Wed, Oct 22, 2014 at 4:56 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>><br>
>> >> wrote:<br>
>> >> > Is a CompoundStatement's start/end loc ever different from<br>
>> >> > lbrace/rbrace<br>
>> >> > location? (maybe when it's a compound statement without braces? But<br>
>> >> > that<br>
>> >> > can<br>
>> >> > never occur in this part of the AST, right)<br>
>> >><br>
>> >> It appears to be possible because you can call setLBracLoc (thank<br>
>> >> goodness we left the "e" off there...), but that looks to only be<br>
>> >> called from ASTReader,<br>
>> >><br>
>> >> > If it isn't, then the if/else<br>
>> >> > LBrace/RBrace bit could be omitted.<br>
>> >><br>
>> >> There's no relationship between compound statements and function try<br>
>> >> block statements, so I'm not certain how we would omit the if/else.<br>
>> ><br>
>> ><br>
>> > Not sure I follow - but CompoundStmt and CXXTryStmt are both Stmts and<br>
>> > all<br>
>> > Stmts have getLocStart/End, right? At least that's my theory...<br>
>><br>
>> Oh, hey, would you look at that? It does, and I was simply not seeing<br>
>> it when I looked. Yes, that's much more clean -- attached patch uses<br>
>> that approach.<br>
>><br>
>> Thanks!<br>
>><br>
>> ~Aaron<br>
><br>
><br>
</div></div></blockquote></div><br></div></div>