crash43.C   [plain text]


// Build don't link: 
// Special g++ Options: -g
// GROUPS passed old-abort
// excess errors test - XFAIL sparc64-*-elf
extern "C" { typedef int jmp_buf[12]; }

enum Error { NO_ERROR };
class ErrorHandler
{
    ErrorHandler *previous;
    static ErrorHandler *error_stack;
    jmp_buf error_buffer;
protected:
    static void pop()
    {
	error_stack = error_stack->previous;
    }
public:
    jmp_buf *push()
    {
	previous = error_stack;
	error_stack = this;
	return &error_buffer;
    }
};