fork download
  1. #include <iostream>
  2. #include <new>
  3.  
  4. struct shit {
  5. shit() {
  6. static int x = 0;
  7. if(x++ == 2)
  8. throw 0;
  9. }
  10. };
  11.  
  12. class Test {
  13. public:
  14. shit* a, *b, *c;
  15. Test() noexcept {
  16. a = new (std::nothrow) shit;
  17. b = new (std::nothrow) shit;
  18. c = new (std::nothrow) shit;
  19. }
  20. ~Test() {
  21. delete a;
  22. }
  23. };
  24.  
  25. int main() {
  26. Test a;
  27. }
Runtime error #stdin #stdout 0s 2980KB
stdin
Standard input is empty
stdout
Standard output is empty