aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.brendan/crash43.C
blob: 5fe54231c89c6127a7ef4eea99f0b2303d8d3e88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Build don't link: 
// Special g++ Options: -g -fno-strict-prototype
// 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;
    }
};