You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
when creating a wrapper for an overloaded c++ function with std::vector arguments, swig warns incorrectly.
For example,
%module sample
%include std_vector.i
class A{};
class B{};
%template(StdVectorA) std::vector<A>;
%template(StdVectorB) std::vector<B>;
void f(const std::vector<A>&);
void f(const std::vector<B>&);
then
$ ../swig -version
SWIG Version 3.0.9
Compiled with g++ [x86_64-apple-darwin13.4.0]
Configured options: +pcre
Please see http://www.swig.org for reporting bugs and further information
$swig -c++ sample.i
sample.i:11: Warning 509: Overloaded method f(std::vector< B > const &) effectively ignored,
sample.i:10: Warning 509: as it is shadowed by f(std::vector< A > const &).
Actually, f(std::vector< B > const &) is NOT shadowed by f(std::vector< A > const &) and the generated code by swig itself seems correct.
Source/Modules/overload.cxx seems not to consider the case the arguments of overloaded functions are the standard containers library of C++.
Regards.
The text was updated successfully, but these errors were encountered:
Still present in 4.0.1, just bumped into it. SWIG doesn't actually ignore the overload as written in the warning; both overloads are generated. It prevents using -Werror, though.
Hi,
when creating a wrapper for an overloaded c++ function with std::vector arguments, swig warns incorrectly.
For example,
then
Actually, f(std::vector< B > const &) is NOT shadowed by f(std::vector< A > const &) and the generated code by swig itself seems correct.
Source/Modules/overload.cxx seems not to consider the case the arguments of overloaded functions are the standard containers library of C++.
Regards.
The text was updated successfully, but these errors were encountered: