fork download
  1. #include <iostream>
  2.  
  3. struct A
  4. {
  5. A(int){throw 1;}
  6. };
  7.  
  8. void f(A)
  9. try
  10. {
  11. }
  12. catch (...)
  13. {
  14. std::cout << "exception caught" << std::endl;
  15. }
  16.  
  17. int main()
  18. {
  19. try
  20. {
  21. f(1);
  22. }
  23. catch (...)
  24. {
  25. std::cout << "this shouldn't occur" << std::endl;
  26. }
  27. }
  28.  
Success #stdin #stdout 0.02s 2856KB
stdin
Standard input is empty
stdout
this shouldn't occur