swig/Examples/test-suite/errors/cpp_template_repeat.i
William S Fulton 4729cf2b1f Duplicate class template instantiations via %template changes
Named duplicate class template instantiations now issue a warning and are ignored.
Duplicate empty class template instantiations are quietly ignored.

The test cases are fixed for this new behaviour.

This commit is a pre-requisite for the near future so that the Python
builtin wrappers can correctly use the SwigType_namestr function without
generating duplicate symbol names.
2022-11-18 19:35:47 +00:00

18 lines
439 B
OpenEdge ABL

%module xxx
template<class T> T blah(T x) { };
%template(iblah) blah<int>;
%template(iiblah) blah<int>;
// empty template instantiations for template functions warn (unlike for template classes)
%template() blah<double>;
%template() blah<double>;
%template() blah<double>;
%template(sblah) blah<short>;
%template(sblah) blah<short>;
%template() blah<const char *>;
%template() blah<const char *>;
%template(sblah) blah<const char *>;