summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/torture/pr33735.C
blob: 0a90745b91e510e56a0abd382637b29c77afd63c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// { dg-do compile }
#include <string>
typedef struct _ts { } PyThreadState;
PyThreadState * Py_NewInterpreter(void);
void Py_EndInterpreter(PyThreadState *);
class ApplicationError {
public:
    ApplicationError(std::string errormsg) : errormsg(errormsg)  { }
    std::string errormsg;
};
void run()
{
    PyThreadState *py_state=__null;
    try {
        if (!(py_state=Py_NewInterpreter()))
            throw ApplicationError("error");
    }
    catch(ApplicationError e) {
        Py_EndInterpreter(py_state);
    }
}