This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/41174] uncaught_exception always returns true
- From: "redi at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Aug 2009 15:31:18 -0000
- Subject: [Bug c++/41174] uncaught_exception always returns true
- References: <bug-41174-18113@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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