1 // Build don't link: 2 // Special g++ Options: -g 3 // GROUPS passed old-abort 4 // excess errors test - XFAIL sparc64-*-elf 5 extern "C" { typedef int jmp_buf[12]; } 6 7 enum Error { NO_ERROR }; 8 class ErrorHandler 9 { 10 ErrorHandler *previous; 11 static ErrorHandler *error_stack; 12 jmp_buf error_buffer; 13 protected: pop()14 static void pop() 15 { 16 error_stack = error_stack->previous; 17 } 18 public: push()19 jmp_buf *push() 20 { 21 previous = error_stack; 22 error_stack = this; 23 return &error_buffer; 24 } 25 }; 26