Prevent "__dummy_0__" template methods from matching name warnings

This commit is contained in:
Seth R Johnson 2018-03-23 14:22:20 -04:00
commit 307c9814a0
3 changed files with 23 additions and 0 deletions

View file

@ -69,3 +69,20 @@ namespace std
#endif
double bar(double native, bool boolean) { return 1.0; }
}
// Test that anonymous template instantiations are ignored from
// %rename/%namewarn
%namewarn(%warningmsg(SWIGWARN_LANG_IDENTIFIER, "incorrectly warning about non-wrapped instantiated template"), error=1) "__dummy_0__";
%inline %{
template<typename T> struct Foo {
typedef T value_type;
};
%}
%template() Foo<int>;
// But they should still generate the correct typemaps etc
%inline %{
int double_an_int(Foo<int>::value_type v) {
return v * 2;
}
%}

View file

@ -0,0 +1,5 @@
from name_warnings import *
four = double_an_int(2)
assert four == 4