This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/41174] uncaught_exception always returns true



------- Comment #1 from redi at gcc dot gnu dot org  2009-08-26 15:31 -------
Reduced:

#include <cassert>
#include <exception>

struct GoodE {
    GoodE()
    {
        try {
            throw 1;
        } catch (...) {
        }
    }
};

struct BadE {
    BadE()
        try {
            throw 1;
        } catch (...) {
        }
};

int main()
{
    try {
        throw GoodE();
    } catch (...) {
        assert( !std::uncaught_exception() );
    }

    try {
        throw BadE();
    } catch (...) {
        assert( !std::uncaught_exception() );
    }
}

Note that GoodE doesn't cause the problem. The difference is that BadE has a
function-try-block


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41174


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]