<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 15, 2016 at 12:15 PM, Richard via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">[Please reply *only* to the list and do not include my email directly<br>
in the To: or Cc: of your reply; otherwise I will not see your reply.<br>
Thanks.]<br>
<br>
Hi,<br>
<br>
Clang-tidy's readability-else-after-return flags constructs such as:<br>
<br>
if (foo) {<br>
return;<br>
} else {<br>
other_stuff();<br>
}<br>
<br>
Since there's no way you can both take the 'if (foo)' branch and the<br>
'else' branch due to the return statement.<br>
<br>
What about similar uses of continue?<br>
<br>
for (auto item : container) {<br>
if (foo) {<br>
continue;<br>
} else {<br>
other_stuff();<br>
}<br>
}<br>
<br>
Here the continue statement has the same effect locally within the<br>
for loop as the return statement had in an enclosing function. In<br>
other words, the following code is equivalent:<br>
<br>
for (auto item : container) {<br>
if (foo) {<br>
continue;<br>
}<br>
other_stuff();<br>
}<br>
<br>
Doesn't a similar situation occur with a break statement in a loop?<br></blockquote><div><br></div><div>Yep. throw as well. (or a call to a noreturn function? Probably) Anything that terminates normal control flow.</div><div> </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">--<br>
"The Direct3D Graphics Pipeline" free book <<a href="http://tinyurl.com/d3d-pipeline" rel="noreferrer" target="_blank">http://tinyurl.com/d3d-pipeline</a>><br>
The Computer Graphics Museum <<a href="http://ComputerGraphicsMuseum.org" rel="noreferrer" target="_blank">http://ComputerGraphicsMuseum.org</a>><br>
The Terminals Wiki <<a href="http://terminals.classiccmp.org" rel="noreferrer" target="_blank">http://terminals.classiccmp.org</a>><br>
Legalize Adulthood! (my blog) <<a href="http://LegalizeAdulthood.wordpress.com" rel="noreferrer" target="_blank">http://LegalizeAdulthood.wordpress.com</a>><br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</font></span></blockquote></div><br></div></div>