Prevent "__dummy_0__" template methods from matching name warnings
This commit is contained in:
parent
de78b80de9
commit
307c9814a0
3 changed files with 23 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
%}
|
||||
|
|
|
|||
5
Examples/test-suite/python/name_warnings_runme.py
Normal file
5
Examples/test-suite/python/name_warnings_runme.py
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
from name_warnings import *
|
||||
|
||||
four = double_an_int(2)
|
||||
assert four == 4
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue