Skip to content

Commit 9f2d953

Browse files
committed
Fix wrapper of template class methods that use one or more argument whose type is defined within same class.
Fixed issue reported in #72
1 parent 2def8c2 commit 9f2d953

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

src/FunctionWrapper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ std::string
454454
FunctionWrapper::arg_decl(int iarg, bool argtypes_only) const{
455455
const auto& argtype = clang_getArgType(method_type, iarg);
456456
// const auto argtypename = fully_qualified_name(argtype); //str(clang_getTypeSpelling(argtype));
457-
const auto argtypename = type_map_.mapped_typename(argtype);
457+
const auto argtypename = fix_template_type(type_map_.mapped_typename(argtype));
458458

459459
if(argtypes_only) return argtypename;
460460

test/TestTemplate2/A.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ namespace ns{
2222

2323
void setval(const S& val){ a = val; }
2424

25+
typedef typename std::string String;
26+
int slen(const String& s) { return s.size(); }
27+
28+
2529
S a;
2630
};
2731

test/TestTemplate2/runTestTemplate2.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@ function runtest()
1414
val = 3
1515
setval(a, val)
1616
@test getval(a) == val
17-
17+
1818
b = TestTemplate2.ns!B{Int32}();
1919
@test getval(b) == 0
2020
val = 5
2121
setval(b, val)
2222
@test getval(b) == val
23+
24+
@test slen(b, "123") == 3
2325
end
2426
end
2527

0 commit comments

Comments
 (0)