[cfe-dev] question about clang warning

David Blaikie via cfe-dev cfe-dev at lists.llvm.org
Wed Apr 12 09:31:46 PDT 2017


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.

On Wed, Apr 12, 2017 at 9:28 AM Caroline Tice <cmtice at google.com> wrote:

> So...is this a bug or not?  Should I file a new issue in buganizer?
>
>
> -- Caroline
> cmtice at google.com
>
> On Mon, Apr 10, 2017 at 9:00 PM, David Blaikie <blaikie at google.com> wrote:
>
>
>
> On Mon, Apr 10, 2017 at 5:53 PM Brian Cain <brian.cain at gmail.com> wrote:
>
> On Mon, Apr 10, 2017 at 6:20 PM, Caroline Tice via cfe-dev <
> cfe-dev at lists.llvm.org> wrote:
>
>
> I'm forwarding this question about clang warnings for a friend:
>
> ...
>
>
>
>
>
> 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?
>
>
> I'm not sure that it's correct but there exist similar test cases that
> would suggest it's the intended behavior.
>
>
> https://github.com/llvm-mirror/clang/blob/master/test/Analysis/dead-stores.c#L483
>
>
> 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.
>
> 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.
>
>
>
>
> This review shows a motivating example for this warning  (which does not
> include nested loops): https://reviews.llvm.org/D2518
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170412/a0b6f4b6/attachment.html>


More information about the cfe-dev mailing list