Skip to content

std::uncaught_exception() true when it should not be anymore #23567

@llvmbot

Description

@llvmbot
Bugzilla Link 23193
Version 3.6
OS FreeBSD
Reporter LLVM Bugzilla Contributor
CC @DougGregor

Extended Description

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillac++11invalidResolved as invalid, i.e. not a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions