Typemap change for templates
For templates only, the template parameters are fully resolved when
handling typemaps. Without this, it is too hard to have decent rules
to apply typemaps when parameter types are typedef'd and template
parameters have default values.
Fixes %clear for typedefs in templates, eg:
%typemap("in") XXX<int>::Long "..."
template typename<T> struct XXX {
typedef long Long;
};
%clear XXX<int>::Long;
as the typemap was previously incorrectly stored as a typemap for long
instead of XXX<int>::Long.
This commit is contained in:
parent
f5cb0420f3
commit
aa2932f409
3 changed files with 132 additions and 2 deletions
32
Examples/test-suite/python/typemap_template_typedef_runme.py
Normal file
32
Examples/test-suite/python/typemap_template_typedef_runme.py
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
from typemap_template_typedef import *
|
||||
|
||||
def check(got, expected):
|
||||
if got != expected:
|
||||
raise RuntimeError("got: " + str(got) + " expected: " + str(expected))
|
||||
|
||||
x = XXXInt()
|
||||
|
||||
check(x.aa1(0), 0)
|
||||
check(x.aa2(0), 55)
|
||||
check(x.aa3(0), 0)
|
||||
check(aa1(0), 0)
|
||||
check(aa2(0), 0)
|
||||
|
||||
check(x.bb1(0), 0)
|
||||
check(x.bb2(0), 66)
|
||||
check(x.bb3(0), 0)
|
||||
check(bb1(0), 0)
|
||||
check(bb2(0), 0)
|
||||
|
||||
check(x.cc1(0), 0)
|
||||
check(x.cc2(0), 77)
|
||||
check(x.cc3(0), 77)
|
||||
check(cc1(0), 0)
|
||||
check(cc2(0), 0)
|
||||
|
||||
check(x.dd1(0), 0)
|
||||
check(x.dd2(0), 88)
|
||||
check(x.dd3(0), 0)
|
||||
check(dd1(0), 0)
|
||||
check(dd2(0), 0)
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue