Unwrap director classes only when returning a pointer or reference to an object

This involves properly counting the number of references and pointers in the return
type of a function and only generate unwrapping code if this number is 1.
For template instances some post-processing code is added to fix the 'decl' and
'type' attributes of functions if changed in an unfavorable way during template
expansion.
This commit fixes swig#1811.
This commit is contained in:
Thomas Reitmayr 2020-06-09 21:58:47 +02:00
commit 01277d700c
9 changed files with 369 additions and 6 deletions

View file

@ -52,6 +52,7 @@ ifeq (node,$(JSENGINE))
apply_signed_char.cpptest: GYP_CFLAGS = \"-Wno-ignored-qualifiers\"
constant_pointers.cpptest: GYP_CFLAGS = \"-Wno-ignored-qualifiers\"
enum_thorough.cpptest: GYP_CFLAGS = \"-Wno-ignored-qualifiers\"
director_unwrap_result.cpptest: GYP_CFLAGS = \"-Wno-ignored-qualifiers\"
setup_node = \
test -d $* || mkdir $* && \