http://llvm.org/bugs/show_bug.cgi?id=19433

            Bug ID: 19433
           Summary: Control-flow gets confused when assert(false) is in a
                    try-block.
           Product: clang
           Version: trunk
          Hardware: Macintosh
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    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
like:

list<int> l;
int foo = l.count();
try {
   l.insert(5);
   assert(false);
   }
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to