summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.robertl/eh990323-3.C
blob: e8369ca764ccce6f673fc3e7e9c3d34423d101b4 (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
26
27
28
29
30
// { dg-do run  }
// try throwing 0 cast to a class object
extern "C" void abort ();
extern "C" void exit (int);

struct A {};

void f()
{
	throw (A*)0;
}

int
main()
{
	int flag;

	flag = 0;
	try {
		f();
	}
	catch (A*) {
		flag = 1;
	}

	if (!flag)
		abort();

	exit (0);
}