<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - std::uncaught_exception() true when it should not be anymore"
   href="https://llvm.org/bugs/show_bug.cgi?id=23193">23193</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>std::uncaught_exception() true when it should not be anymore
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>C++11
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>alexis@m2osw.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I wrote a test suite for Zipios++ (<a href="https://sourceforge.net/projects/zipios/">https://sourceforge.net/projects/zipios/</a>)
using Catch.hpp (<a href="https://github.com/philsquared/Catch">https://github.com/philsquared/Catch</a>).

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.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>