[LLVMbugs] [Bug 23193] New: std::uncaught_exception() true when it should not be anymore

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Apr 10 12:44:56 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=23193

            Bug ID: 23193
           Summary: std::uncaught_exception() true when it should not be
                    anymore
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: alexis at m2osw.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

I wrote a test suite for Zipios++ (https://sourceforge.net/projects/zipios/)
using Catch.hpp (https://github.com/philsquared/Catch).

There seems to be a problem with std::uncaught_exception() when I run the code
under FreeBSD 10.1 with version 3.4.1 of clang. (20140512)

The software will throw exceptions that are gobbled in some way (caught), but
std::uncaught_exception() continues to return true on normal return.

    // here std::uncaught_exception() is false
    run_a_test();
    // here std::uncaught_exception() is true

One example where I get the problem, a streambuf throws an exception which is
caught in the read() function of the iostream implementation (as expected) but
then std::uncaught_exception() remains true even though the try/catch should
have cleared it.

The easiest way to reproduce is to get FreeBSD, compile Zipios++ and run the
test suite. With a copy of catch.hpp (single header file) under contrib/... you
can just type:

    dev/build

and that will happen.

Note that I commented out a certain number of tests at this time. You probably
want to edit the tests/catch_zipfile.cpp and remove the `#ifndef __clang__` to
make sure you get the errors. Without those guards it is reproducible by just
these two or three tests where such appears.

Let me know if you need any help with getting things to replicate the problem.

-- 
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/20150410/e9f0ed70/attachment.html>


More information about the llvm-bugs mailing list