<div dir="ltr">My best guess is that it's a bug, yes - though I'm hardly an expert here. Filing a bug seems like a fine idea. Maybe cc rtrieu in case he's interested.<br><br><div class="gmail_quote"><div dir="ltr">On Wed, Apr 12, 2017 at 9:28 AM Caroline Tice <<a href="mailto:cmtice@google.com">cmtice@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg">So...is this a bug or not? Should I file a new issue in buganizer?<div class="gmail_extra gmail_msg"><br clear="all" class="gmail_msg"><div class="gmail_msg"><div class="m_1953787544539158394gmail_signature gmail_msg" data-smartmail="gmail_signature"><div dir="ltr" class="gmail_msg"><div class="gmail_msg"><div dir="ltr" class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">-- Caroline<br class="gmail_msg"><a href="mailto:cmtice@google.com" class="gmail_msg" target="_blank">cmtice@google.com</a><br class="gmail_msg"></div></div></div></div></div></div></div></div><div dir="ltr" class="gmail_msg"><div class="gmail_extra gmail_msg">
<br class="gmail_msg"><div class="gmail_quote gmail_msg">On Mon, Apr 10, 2017 at 9:00 PM, David Blaikie <span dir="ltr" class="gmail_msg"><<a href="mailto:blaikie@google.com" class="gmail_msg" target="_blank">blaikie@google.com</a>></span> wrote:<br class="gmail_msg"><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg"><br class="gmail_msg"><br class="gmail_msg"><div class="gmail_quote gmail_msg"><span class="gmail_msg"><div dir="ltr" class="gmail_msg">On Mon, Apr 10, 2017 at 5:53 PM Brian Cain <<a href="mailto:brian.cain@gmail.com" class="gmail_msg" target="_blank">brian.cain@gmail.com</a>> wrote:<br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg"><div class="gmail_extra m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg"><div class="gmail_quote m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg">On Mon, Apr 10, 2017 at 6:20 PM, Caroline Tice via cfe-dev <span dir="ltr" class="m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg"><<a href="mailto:cfe-dev@lists.llvm.org" class="m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br class="m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg"></div></div></div><div dir="ltr" class="m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg"><div class="gmail_extra m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg"><div class="gmail_quote m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg"><blockquote class="gmail_quote m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr" class="m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg"><div class="m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg"><br class="m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg"></div><div class="m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg">I'm forwarding this question about clang warnings for a friend:</div></div></blockquote></div></div></div><div dir="ltr" class="m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg"><div class="gmail_extra m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg"><div class="gmail_quote m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg"><blockquote class="gmail_quote m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr" class="m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg"><div class="m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg">...</div></div></blockquote></div></div></div><div dir="ltr" class="m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg"><div class="gmail_extra m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg"><div class="gmail_quote m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg"><div class="m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg"><br class="m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg"></div><div class="m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg"> </div><blockquote class="gmail_quote m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr" class="m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg"><div class="m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg"><br class="m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg"></div><div class="m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg">In my understanding the break statement is clearly part of the switch construct and in this context there is a single loop, it is not clear why clang is referring to an enclosing loop. Could someone verify that this is correct and explain why?<br class="m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg"></div><div class="m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg"><br class="m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg"></div></div></blockquote><div class="m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg"><br class="m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg"></div></div></div></div><div dir="ltr" class="m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg"><div class="gmail_extra m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg"><div class="gmail_quote m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg"><div class="m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg">I'm not sure that it's correct but there exist similar test cases that would suggest it's the intended behavior. </div><div class="m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg"><br class="m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg"></div><div class="m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg"><a href="https://github.com/llvm-mirror/clang/blob/master/test/Analysis/dead-stores.c#L483" class="m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg" target="_blank">https://github.com/llvm-mirror/clang/blob/master/test/Analysis/dead-stores.c#L483</a></div></div></div></div></blockquote></span><div class="gmail_msg"><br class="gmail_msg">Not sure that's equivalent/related - in this case the break is inside a switch and seems to pertain to that switch. Doesn't look to me like it has anything to do with any loops.<br class="gmail_msg"><br class="gmail_msg">My read on this is that it's a false positive - probably "any break in a statement expression" triggers this, instead of it being a bit more selective about whether that break appears within some other breakable scope.<br class="gmail_msg"> </div><span class="gmail_msg"><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg"><div class="gmail_extra m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg"><div class="gmail_quote m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg"><div class="m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg"><br class="m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg"></div><div class="m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg"><br class="m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg"></div><div class="m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg">This review shows a motivating example for this warning (which does not include nested loops): <a href="https://reviews.llvm.org/D2518" class="m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg" target="_blank">https://reviews.llvm.org/D2518</a></div><div class="m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg"><br class="m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg"></div><div class="m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg"><br class="m_1953787544539158394m_3626452455507115836gmail_msg gmail_msg"></div></div>
</div></div>
</blockquote></span></div></div>
</blockquote></div><br class="gmail_msg"></div></div></blockquote></div></div>