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:
ApplicationError(std::string errormsg)8     ApplicationError(std::string errormsg) : errormsg(errormsg)  { }
9     std::string errormsg;
10 };
run()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 }
22