[LLVMbugs] [Bug 19433] New: Control-flow gets confused when assert(false) is in a try-block.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Apr 14 21:32:10 PDT 2014


            Bug ID: 19433
           Summary: Control-flow gets confused when assert(false) is in a
           Product: clang
           Version: trunk
          Hardware: Macintosh
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
          Assignee: kremenek at apple.com
          Reporter: mclow.lists at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 12372
  --> http://llvm.org/bugs/attachment.cgi?id=12372&action=edit
Small program demonstrating the problem.

I tried running scan_build on the libc++ test suite, and got a false positive.

there's a reduced example attached, but basically, the code in question looks

list<int> l;
int foo = l.count();
try {
catch (...) {}
assert ( foo == l.count());

where the call to "l.insert" will throw.

scan-build complains that "foo" is initialized but never read.
[ and yes, I have exceptions enabled ]

If I remove the assert(false), then the warning goes away.

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140415/de039563/attachment.html>

More information about the llvm-bugs mailing list