diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/torture/pr33735.C')
-rw-r--r-- | gcc/testsuite/g++.dg/torture/pr33735.C | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/torture/pr33735.C b/gcc/testsuite/g++.dg/torture/pr33735.C new file mode 100644 index 000000000..0a90745b9 --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr33735.C @@ -0,0 +1,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); + } +} |