fix %ignore *::Bar::foo case
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6910 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
a80aa7fe40
commit
9c9985bd6f
2 changed files with 37 additions and 15 deletions
|
|
@ -2,20 +2,32 @@
|
||||||
|
|
||||||
%ignore Foo;
|
%ignore Foo;
|
||||||
|
|
||||||
|
%ignore *::Bar::foo;
|
||||||
|
|
||||||
%inline %{
|
%inline %{
|
||||||
class Foo {
|
class Foo {
|
||||||
public:
|
public:
|
||||||
virtual ~Foo() { }
|
virtual ~Foo() { }
|
||||||
virtual char *blah() = 0;
|
virtual char *blah() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
class Bar : public Foo {
|
namespace hi
|
||||||
public:
|
{
|
||||||
virtual char *blah() { return (char *) "Bar::blah"; }
|
namespace hello
|
||||||
};
|
{
|
||||||
|
class Bar : public Foo {
|
||||||
|
public:
|
||||||
|
void foo(void) {};
|
||||||
|
|
||||||
char *do_blah(Foo *f) {
|
virtual char *blah() { return (char *) "Bar::blah"; }
|
||||||
return f->blah();
|
};
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
char *do_blah(Foo *f) {
|
||||||
|
return f->blah();
|
||||||
|
}
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -457,18 +457,28 @@ Swig_name_object_get(Hash *namehash, String *prefix, String *name, SwigType *dec
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/* Perform a class-based lookup (if class prefix supplied) */
|
/* Perform a class-based lookup (if class prefix supplied) */
|
||||||
if (prefix) {
|
if (prefix) {
|
||||||
if (Len(prefix)) {
|
if (Len(prefix)) {
|
||||||
tname = NewStringf("%s::%s",prefix,name);
|
tname = NewStringf("%s::%s",prefix,name);
|
||||||
rn = name_object_get(namehash, tname, decl, ncdecl);
|
rn = name_object_get(namehash, tname, decl, ncdecl);
|
||||||
Delete(tname);
|
Delete(tname);
|
||||||
|
if (!rn) {
|
||||||
|
String *cls = Swig_scopename_last(prefix);
|
||||||
|
if (Strcmp(cls,prefix)!= 0) {
|
||||||
|
tname = NewStringf("*::%s::%s",cls,name);
|
||||||
|
rn = name_object_get(namehash, tname, decl, ncdecl);
|
||||||
|
Delete(tname);
|
||||||
|
}
|
||||||
|
Delete(cls);
|
||||||
|
}
|
||||||
/* A template-based class lookup */
|
/* A template-based class lookup */
|
||||||
if (!rn && SwigType_istemplate(prefix)) {
|
if (!rn && SwigType_istemplate(prefix)) {
|
||||||
String *tprefix = SwigType_templateprefix(prefix);
|
String *tprefix = SwigType_templateprefix(prefix);
|
||||||
tname = NewStringf("%s::%s",tprefix,name);
|
if (Strcmp(tprefix,prefix) != 0) {
|
||||||
rn = name_object_get(namehash, tname, decl, ncdecl);
|
rn = Swig_name_object_get(namehash, tprefix, name, decl);
|
||||||
Delete(tname);
|
}
|
||||||
Delete(tprefix);
|
Delete(tprefix);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue