Merge -r 127928:132243 from trunk
[official-gcc.git] / gcc / testsuite / g++.dg / torture / pr33735.C
blob0a90745b91e510e56a0abd382637b29c77afd63c
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;
11 void run()
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     }