Fix partial overloading warning messages appearing
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12527 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
5f4d8c6112
commit
c8b89bd075
4 changed files with 32 additions and 3 deletions
13
Examples/test-suite/errors/cpp_overload_const.i
Normal file
13
Examples/test-suite/errors/cpp_overload_const.i
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
%module xxx
|
||||
|
||||
void check(const int *v) {}
|
||||
void check(int *v) {}
|
||||
void check(int &v) {}
|
||||
void check(const int &v) {} // note: no warning as marshalled by value
|
||||
|
||||
struct OverStruct {};
|
||||
void check(const OverStruct *v) {}
|
||||
void check(OverStruct *v) {}
|
||||
void check(OverStruct &v) {}
|
||||
void check(const OverStruct &v) {}
|
||||
|
||||
|
|
@ -288,6 +288,18 @@ cpp_nobase.i:6: Warning 401: Maybe you forgot to instantiate 'Bar< int >' using
|
|||
|
||||
:::::::::::::::::::::::::::::::: cpp_overload.i :::::::::::::::::::::::::::::::::::
|
||||
|
||||
:::::::::::::::::::::::::::::::: cpp_overload_const.i :::::::::::::::::::::::::::::::::::
|
||||
cpp_overload_const.i:4: Warning 509: Overloaded method check(int *) effectively ignored,
|
||||
cpp_overload_const.i:3: Warning 509: as it is shadowed by check(int const *).
|
||||
cpp_overload_const.i:5: Warning 509: Overloaded method check(int &) effectively ignored,
|
||||
cpp_overload_const.i:3: Warning 509: as it is shadowed by check(int const *).
|
||||
cpp_overload_const.i:10: Warning 509: Overloaded method check(OverStruct *) effectively ignored,
|
||||
cpp_overload_const.i:9: Warning 509: as it is shadowed by check(OverStruct const *).
|
||||
cpp_overload_const.i:11: Warning 509: Overloaded method check(OverStruct &) effectively ignored,
|
||||
cpp_overload_const.i:9: Warning 509: as it is shadowed by check(OverStruct const *).
|
||||
cpp_overload_const.i:12: Warning 509: Overloaded method check(OverStruct const &) effectively ignored,
|
||||
cpp_overload_const.i:9: Warning 509: as it is shadowed by check(OverStruct const *).
|
||||
|
||||
:::::::::::::::::::::::::::::::: cpp_private_defvalue.i :::::::::::::::::::::::::::::::::::
|
||||
|
||||
:::::::::::::::::::::::::::::::: cpp_private_inherit.i :::::::::::::::::::::::::::::::::::
|
||||
|
|
|
|||
|
|
@ -76,6 +76,7 @@ cpp_nested
|
|||
cpp_no_access
|
||||
cpp_nobase
|
||||
cpp_overload
|
||||
cpp_overload_const
|
||||
cpp_private_defvalue
|
||||
cpp_private_inherit
|
||||
cpp_recursive_typedef
|
||||
|
|
|
|||
|
|
@ -231,11 +231,12 @@ List *Swig_overload_rank(Node *n, bool script_lang_wrapping) {
|
|||
Swig_warning(WARN_LANG_OVERLOAD_CONST, Getfile(nodes[i].n), Getline(nodes[i].n),
|
||||
"using non-const method %s instead.\n", Swig_name_decl(nodes[i].n));
|
||||
} else {
|
||||
if (!Getattr(nodes[j].n, "overload:ignore"))
|
||||
if (!Getattr(nodes[j].n, "overload:ignore")) {
|
||||
Swig_warning(WARN_LANG_OVERLOAD_IGNORED, Getfile(nodes[j].n), Getline(nodes[j].n),
|
||||
"Overloaded method %s ignored,\n", Swig_name_decl(nodes[j].n));
|
||||
Swig_warning(WARN_LANG_OVERLOAD_IGNORED, Getfile(nodes[i].n), Getline(nodes[i].n),
|
||||
"using %s instead.\n", Swig_name_decl(nodes[i].n));
|
||||
}
|
||||
}
|
||||
}
|
||||
nodes[j].error = 1;
|
||||
|
|
@ -248,11 +249,12 @@ List *Swig_overload_rank(Node *n, bool script_lang_wrapping) {
|
|||
Swig_warning(WARN_LANG_OVERLOAD_CONST, Getfile(nodes[i].n), Getline(nodes[i].n),
|
||||
"using non-const method %s instead.\n", Swig_name_decl(nodes[i].n));
|
||||
} else {
|
||||
if (!Getattr(nodes[j].n, "overload:ignore"))
|
||||
if (!Getattr(nodes[j].n, "overload:ignore")) {
|
||||
Swig_warning(WARN_LANG_OVERLOAD_IGNORED, Getfile(nodes[j].n), Getline(nodes[j].n),
|
||||
"Overloaded method %s ignored,\n", Swig_name_decl(nodes[j].n));
|
||||
Swig_warning(WARN_LANG_OVERLOAD_IGNORED, Getfile(nodes[i].n), Getline(nodes[i].n),
|
||||
"using %s instead.\n", Swig_name_decl(nodes[i].n));
|
||||
}
|
||||
}
|
||||
}
|
||||
nodes[j].error = 1;
|
||||
|
|
@ -270,11 +272,12 @@ List *Swig_overload_rank(Node *n, bool script_lang_wrapping) {
|
|||
Swig_warning(WARN_LANG_OVERLOAD_SHADOW, Getfile(nodes[i].n), Getline(nodes[i].n),
|
||||
"as it is shadowed by %s.\n", Swig_name_decl(nodes[i].n));
|
||||
} else {
|
||||
if (!Getattr(nodes[j].n, "overload:ignore"))
|
||||
if (!Getattr(nodes[j].n, "overload:ignore")) {
|
||||
Swig_warning(WARN_LANG_OVERLOAD_IGNORED, Getfile(nodes[j].n), Getline(nodes[j].n),
|
||||
"Overloaded method %s ignored,\n", Swig_name_decl(nodes[j].n));
|
||||
Swig_warning(WARN_LANG_OVERLOAD_IGNORED, Getfile(nodes[i].n), Getline(nodes[i].n),
|
||||
"using %s instead.\n", Swig_name_decl(nodes[i].n));
|
||||
}
|
||||
}
|
||||
nodes[j].error = 1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue