help-rcs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug optimization/14535] [3.3/3.4/3.5 Regression] exception throwing in


From: bangerth at dealii dot org
Subject: [Bug optimization/14535] [3.3/3.4/3.5 Regression] exception throwing in virtual function doesn't turn on the local destructors
Date: 11 Mar 2004 16:19:52 -0000

------- 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]