OSDN Git Service

2009-04-03 Richard Guenther <rguenther@suse.de>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / torture / pr33735.C
1 // { dg-do compile }
2 #include <string>
3 typedef struct _ts { } PyThreadState;
4 PyThreadState * Py_NewInterpreter(void);
5 void Py_EndInterpreter(PyThreadState *);
6 class ApplicationError {
7 public:
8     ApplicationError(std::string errormsg) : errormsg(errormsg)  { }
9     std::string errormsg;
10 };
11 void run()
12 {
13     PyThreadState *py_state=__null;
14     try {
15         if (!(py_state=Py_NewInterpreter()))
16             throw ApplicationError("error");
17     }
18     catch(ApplicationError e) {
19         Py_EndInterpreter(py_state);
20     }
21 }