Exception translation generates invalid code if return value is wrapped (i.e. not primitive)

Bug #780945 reported by Kirill Lapshin
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
PyBindGen
Fix Released
Undecided
Unassigned

Bug Description

Adding to foo.h

Tupl my_throwing_func () throw(std::exception);

generates invalid C++ code, which fails to compile with following error:

default/tests/foomodulegen_module2.cc: In function ‘PyObject* _wrap_foo4_my_throwing_func()’:
default/tests/foomodulegen_module2.cc:778: error: ‘retval’ was not declared in this scope

Same problem can also be triggered with new 'throw' annotation:

// -#- throw=std::exception -#-
Tupl my_throwing_func ();

Related branches

Gustavo Carneiro (gjc)
Changed in pybindgen:
status: New → Fix Committed
Revision history for this message
Riyaz Haque (rfhaque) wrote :

The bug still manifests if the return value is a reference. The error generated now is:

foo.cc: In function 'PyObject* _wrap_PyFoo_errorFunc(PyFoo*, PyObject*, PyObject*)':
foo.cc:630: error: 'retval' declared as reference but not initialized

Gustavo Carneiro (gjc)
Changed in pybindgen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.