Fixed odd class scope bug.
class Foo {
public:
int Foo::bar(int x);
};
SWIG just drops the "Foo" prefix the method and continues (previously,
the declaration was ignored entirely).
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4591 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
f0b063ef3e
commit
4138222abd
1 changed files with 16 additions and 2 deletions
|
|
@ -2088,8 +2088,22 @@ c_decl : storage_class type declarator initializer c_decl_tail {
|
||||||
|
|
||||||
/* Look for "::" declarations (ignored) */
|
/* Look for "::" declarations (ignored) */
|
||||||
if (Strstr($3.id,"::")) {
|
if (Strstr($3.id,"::")) {
|
||||||
Delete($$);
|
if (Namespaceprefix) {
|
||||||
$$ = $5;
|
/* This is a special case. If the scope name of the declaration exactly
|
||||||
|
matches that of the declaration, then we will allow it. Otherwise, delete. */
|
||||||
|
String *p = Swig_scopename_prefix($3.id);
|
||||||
|
if (Strcmp(p,Namespaceprefix) == 0) {
|
||||||
|
Setattr($$,"name",Swig_scopename_last($3.id));
|
||||||
|
set_nextSibling($$,$5);
|
||||||
|
} else {
|
||||||
|
Delete($$);
|
||||||
|
$$ = $5;
|
||||||
|
}
|
||||||
|
Delete(p);
|
||||||
|
} else {
|
||||||
|
Delete($$);
|
||||||
|
$$ = $5;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
set_nextSibling($$,$5);
|
set_nextSibling($$,$5);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue