[Bug optimization/14535] [3.3/3.4/3.5 Regression] exception throwing in virtual function doesn't turn on the local destructors
bangerth at dealii dot org
gcc-bugzilla@gcc.gnu.org
Thu Mar 11 16:19:00 GMT 2004
------- Additional Comments From bangerth at dealii dot org 2004-03-11 16:19 -------
Confirmed indeed. Here is something more selfcontained:
---------------------
extern "C" void abort();
bool destructor_called = false;
struct B {
virtual void Run(){};
};
struct D : public B {
virtual void Run()
{
struct O {
~O() { destructor_called = true; };
} o;
struct Raiser {
Raiser() throw( int ) {throw 1;};
} raiser;
};
};
int main() {
try {
D d;
static_cast<B&>(d).Run();
} catch (...) {}
if (!destructor_called)
abort ();
}
-----------------------
g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ x.cc ; ./a.out
g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -finline x.cc ; ./a.out
Aborted
W.
--
What |Removed |Added
----------------------------------------------------------------------------
Known to fail|3.4.0 3.3.1 3.5.0 tree-ssa |3.4.0 3.3.1 3.5.0 tree-ssa
| |3.2.3
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14535
More information about the Gcc-bugs
mailing list