fork download
  1. #include <iostream>
  2. using namespace std;
  3. struct C
  4. {
  5. C() { cout << __FUNCTION__ << endl; }
  6. ~C() { cout << __FUNCTION__ << endl; }
  7. };
  8.  
  9. struct E: public C
  10. {
  11. C c;
  12. E() { cout << __FUNCTION__ << endl; throw 4; }
  13. ~E() { cout << __FUNCTION__ << endl; }
  14. };
  15.  
  16. int main()
  17. {
  18. try {
  19. E e;
  20. } catch(int) {
  21. }
  22. }
  23.  
Success #stdin #stdout 0s 2960KB
stdin
Standard input is empty
stdout
C
C
E
~C
~C